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

Decode_n_tokens yield eos/eot token #1474

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

nlpfollower
Copy link
Contributor

Seems like we should yield the cur_token/next_token when it's an eos or eot so that it is included in the generator_func in chat. Also this way start_pos is incremented to an empty position in the cache. Repro similar to #1462, although there is no visible response degradation.

I've pushed logs from my trace (nlpfollower#2). You can see how without this yield the first id in the input_pos at the beginning of a round overlaps, and overwrites, the last cache entry made in the previous turn.

Copy link

pytorch-bot bot commented Jan 23, 2025

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/torchchat/1474

Note: Links to docs will display an error until the docs builds have been completed.

✅ No Failures

As of commit aef0b8b with merge base 42c52bf (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Meta Open Source bot. label Jan 23, 2025
@Jack-Khuu
Copy link
Contributor

Thanks for another fix; I'll try to verify over the weekend

Copy link
Contributor

@Jack-Khuu Jack-Khuu left a comment

Choose a reason for hiding this comment

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

My guts says this is legit, I'll give it another look

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Meta Open Source bot.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants