Skip to content

Commit

Permalink
Fix max tokens default value in text generation and chat completion (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
hanouticelina authored Nov 4, 2024
1 parent 1da4018 commit 4011b5a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/huggingface_hub/inference/_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,7 @@ def chat_completion(
Whether to return log probabilities of the output tokens or not. If true, returns the log
probabilities of each output token returned in the content of message.
max_tokens (`int`, *optional*):
Maximum number of tokens allowed in the response. Defaults to 20.
Maximum number of tokens allowed in the response. Defaults to 100.
n (`int`, *optional*):
UNUSED.
presence_penalty (`float`, *optional*):
Expand Down Expand Up @@ -2075,7 +2075,7 @@ def text_generation(
grammar ([`TextGenerationInputGrammarType`], *optional*):
Grammar constraints. Can be either a JSONSchema or a regex.
max_new_tokens (`int`, *optional*):
Maximum number of generated tokens
Maximum number of generated tokens. Defaults to 100.
repetition_penalty (`float`, *optional*):
The parameter for repetition penalty. 1.0 means no penalty. See [this
paper](https://arxiv.org/pdf/1909.05858.pdf) for more details.
Expand Down
4 changes: 2 additions & 2 deletions src/huggingface_hub/inference/_generated/_async_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,7 @@ async def chat_completion(
Whether to return log probabilities of the output tokens or not. If true, returns the log
probabilities of each output token returned in the content of message.
max_tokens (`int`, *optional*):
Maximum number of tokens allowed in the response. Defaults to 20.
Maximum number of tokens allowed in the response. Defaults to 100.
n (`int`, *optional*):
UNUSED.
presence_penalty (`float`, *optional*):
Expand Down Expand Up @@ -2138,7 +2138,7 @@ async def text_generation(
grammar ([`TextGenerationInputGrammarType`], *optional*):
Grammar constraints. Can be either a JSONSchema or a regex.
max_new_tokens (`int`, *optional*):
Maximum number of generated tokens
Maximum number of generated tokens. Defaults to 100.
repetition_penalty (`float`, *optional*):
The parameter for repetition penalty. 1.0 means no penalty. See [this
paper](https://arxiv.org/pdf/1909.05858.pdf) for more details.
Expand Down

0 comments on commit 4011b5a

Please sign in to comment.