Skip to content

Commit

Permalink
max_tokens and stop_at should default to None
Browse files Browse the repository at this point in the history
  • Loading branch information
parkervg committed Sep 1, 2024
1 parent c900e63 commit 1d25880
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions blendsql/ingredients/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@ def generate(model: Model, *args, **kwargs) -> str:

@generate.register(OpenaiLLM)
def generate_openai(
model: OpenaiLLM, prompt, max_tokens: Optional[int], stop_at: List[str], **kwargs
model: OpenaiLLM,
prompt,
max_tokens: Optional[int] = None,
stop_at: List[str] = None,
**kwargs,
) -> str:
"""This function only exists because of a bug in guidance
https://github.com/guidance-ai/guidance/issues/881
Expand All @@ -36,7 +40,11 @@ def generate_openai(

@generate.register(AnthropicLLM)
def generate_anthropic(
model: AnthropicLLM, prompt, max_tokens: Optional[int], stop_at: List[str], **kwargs
model: AnthropicLLM,
prompt,
max_tokens: Optional[int] = None,
stop_at: Optional[List[str]] = None,
**kwargs,
):
client = model.model_obj.engine.anthropic
return (
Expand Down

0 comments on commit 1d25880

Please sign in to comment.