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 IndexError caused by invalid token IDs in CFGGuide #1251

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

Conversation

RohitRathore1
Copy link

@RohitRathore1 RohitRathore1 commented Nov 7, 2024

It fixes issue #1232

These changes fix the IndexError caused by invalid token IDs in allowed_tokens_concat by handling eos_token_id appropriately and adjusting token handling in CFGGuide. The updates maintain backward compatibility and ensure that existing functionality continues to work as expected.

Tested on CPU:

Loading checkpoint shards: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 5/5 [00:08<00:00,  1.76s/it]
Saturn
\{[ ]?"caption"[ ]?:[ ]?"([^"\\\x00-\x1F\x7F-\x9F]|\\["\\])*"[ ]?\}
{"caption":"Command module pilot Buzz Aldrin walks across the lunar surface behind the deployed Lunar folloteneer's Ramp. The bottom of a Life Science Branch leg lock is framed in a footprint on the lunar surface behind the left leg of Aldrin's suit. The videocamera on the fullmomteiner's chest is visible atop the open hatch. Apollo 11, Aug. #42; CC AS11-40-5924,"}

@rlouf rlouf added this to the 0.1.3 milestone Nov 8, 2024
@rlouf
Copy link
Member

rlouf commented Nov 27, 2024

Thank you for contributing! Could you add a test that fails on current main and passes here?

@RohitRathore1 RohitRathore1 force-pushed the fix-invalid-token-id-indexerror branch from 564b241 to 668ea42 Compare November 28, 2024 06:55
@RohitRathore1
Copy link
Author

Thank you for contributing! Could you add a test that fails on current main and passes here?

Thank you for contributing! Could you add a test that fails on current main and passes here?

Hi @rlouf to me it doesn't seem related to my changes. Let me have a deeper look

@rlouf
Copy link
Member

rlouf commented Nov 28, 2024

Thank you for making the change :) Is it good for review?

@RohitRathore1
Copy link
Author

Thank you for making the change :) Is it good for review?

Hi @rlouf Yes, it is ready to review now. I have provided the correct model name which was the reason to fail oneof our test case.

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