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

regex stopping condition #2035

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jancervenka
Copy link

@jancervenka jancervenka commented Nov 14, 2024

Motivation

Hi @merrymercy! I am interested in contributing to the SGLang project so I gave this issue a shot: #2007 Is this a sensible approach? I am a very new to the project so any pointers are welcomed.

I will add tests and update the docs once the change looks ok to you. I am actually having troubles getting the project running on my machine so I haven't been able to test it yet.

Checklist

  • Format your code according to the Contributor Guide.
  • Add unit tests as outlined in the Contributor Guide.
  • Update documentation as needed, including docstrings or example tutorials.

Copy link
Contributor

@merrymercy merrymercy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. It is better to implement it here
    def check_finished(self):
  2. Can you add a new argument for this stop condition, so we do not make the old simple string match slower? You can add a new field at SamplingParameters

@jancervenka
Copy link
Author

thank you @merrymercy. In Req.check_finished, is it ok to ignore tail_str and just check decoded_text? Because we don't know ho many tokens to decode to get a regex match.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants