Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Update AsyncClient with ignore_eos_token parameter #341

Merged
merged 1 commit into from
Mar 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions clients/python/lorax/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,7 @@ async def generate(
api_token: Optional[str] = None,
do_sample: bool = False,
max_new_tokens: int = 20,
ignore_eos_token: bool = False,
best_of: Optional[int] = None,
repetition_penalty: Optional[float] = None,
return_full_text: bool = False,
Expand Down Expand Up @@ -423,6 +424,8 @@ async def generate(
Activate logits sampling
max_new_tokens (`int`):
Maximum number of generated tokens
ignore_eos_token (`bool`):
Whether to ignore EOS tokens during generation
best_of (`int`):
Generate best_of sequences and return the one if the highest token logprobs
repetition_penalty (`float`):
Expand Down Expand Up @@ -481,6 +484,7 @@ async def generate(
return_k_alternatives=return_k_alternatives,
do_sample=do_sample,
max_new_tokens=max_new_tokens,
ignore_eos_token=ignore_eos_token,
repetition_penalty=repetition_penalty,
return_full_text=return_full_text,
seed=seed,
Expand Down Expand Up @@ -514,6 +518,7 @@ async def generate_stream(
api_token: Optional[str] = None,
do_sample: bool = False,
max_new_tokens: int = 20,
ignore_eos_token: bool = False,
repetition_penalty: Optional[float] = None,
return_full_text: bool = False,
seed: Optional[int] = None,
Expand Down Expand Up @@ -547,6 +552,8 @@ async def generate_stream(
Activate logits sampling
max_new_tokens (`int`):
Maximum number of generated tokens
ignore_eos_token (`bool`):
Whether to ignore EOS tokens during generation
repetition_penalty (`float`):
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 Expand Up @@ -601,6 +608,7 @@ async def generate_stream(
return_k_alternatives=return_k_alternatives,
do_sample=do_sample,
max_new_tokens=max_new_tokens,
ignore_eos_token=ignore_eos_token,
repetition_penalty=repetition_penalty,
return_full_text=return_full_text,
seed=seed,
Expand Down
Loading