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

[Bug?] gen() without max_token parameter is limited to 16 tokens long by default. #590

Closed
objnf-dev opened this issue Jul 4, 2024 · 1 comment
Labels
good first issue Good for newcomers

Comments

@objnf-dev
Copy link
Contributor

objnf-dev commented Jul 4, 2024

In functions wrapped by @sglang.function, sglang.gen() without max_token= parameter will generate less than 16 tokens by default, which is defined in SglFunction.run():

def run(
        self,
        *args,
        max_new_tokens: int = 16,
        ...
):

16 is too short for most situations and may produce unexpected results, such as incomplete JSON generations.

May be related: #211 #360

@merrymercy
Copy link
Contributor

merrymercy commented Jul 9, 2024

This is the default argument. Could you send a PR to make the default argument larger?

@merrymercy merrymercy added the good first issue Good for newcomers label Jul 9, 2024
foszto added a commit to foszto/sglang that referenced this issue Aug 7, 2024
Ying1123 added a commit that referenced this issue Aug 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants