Skip to content

Fix jump forward final state circular path bug.#1084

Merged
hnyls2002 merged 1 commit intomainfrom
fix-jump-forward
Aug 14, 2024
Merged

Fix jump forward final state circular path bug.#1084
hnyls2002 merged 1 commit intomainfrom
fix-jump-forward

Conversation

@hnyls2002
Copy link
Copy Markdown
Collaborator

@hnyls2002 hnyls2002 commented Aug 14, 2024

Thank you for your contribution, we really appreciate it. The following instructions will help improve your pull request and make it easier to receive feedback. If there are any items you don't understand, don't worry. Just submit the pull request and ask the maintainers for help.

Motivation

The final states in an FSM can lead to termination, which should be considered as a nature outgoing edge.

Modification

Initiate the outgoing edge counters with final states 1.

Example

the regular expression r"[-+]?[0-9]+[ ]*"'s FSM has a loop containing a final state, which will be considered as a jump-forwardable state in the previous implementation.

Checklist

  1. Ensure pre-commit pre-commit run --all-files or other linting tools are used to fix potential lint issues.
  2. Confirm that modifications are covered by complete unit tests. If not, please add more unit tests for correctness.
  3. Modify documentation as needed, such as docstrings or example tutorials.

@hnyls2002 hnyls2002 enabled auto-merge (squash) August 14, 2024 02:47
@hnyls2002 hnyls2002 disabled auto-merge August 14, 2024 04:13
@hnyls2002 hnyls2002 merged commit e205527 into main Aug 14, 2024
@hnyls2002 hnyls2002 deleted the fix-jump-forward branch August 14, 2024 04:14
Comment thread python/sglang/srt/constrained/jump_forward.py
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