-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
support llama3 #3259
support llama3 #3259
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! added a few comments.
for i, (role, message) in enumerate(self.messages): | ||
if message: | ||
ret += f"<|start_header_id|>{role}<|end_header_id|>\n\n" | ||
ret += f"{message.strip()}<|eot_id|>" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why message.strip()?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I follow the code from llama3 repo to add the strip.
https://github.com/meta-llama/llama3/blob/0cee08ec68f4cfc0c89fe4a9366d82679aaa2a66/llama/tokenizer.py#L214
I tested these changes and it works perfectly! |
I am using it and I still have runaway answers. Example: Just wrote "ah yea" and this was the answer:
|
Llama 3 Instruct have some issue to generate the end token conversation. https://huggingface.co/meta-llama/Meta-Llama-3-8B-Instruct/discussions/4 Llama 3 define <|end_of_text|> 128001 as eos token. However, generation doesn't raise it well.
i made this ugly hard fix in my environnement and it work well:
|
I think there are problems in the
As mentioned here: the prompt not add the |
@sohelzerdoumi @Oscarjia any chance you could help us submit a PR to fix this? appreciate your help! |
* original_lmsys/operation: (70 commits) format update update update format update update update Small fix in clean_chat_data (lm-sys#3285) support llama3 (lm-sys#3259) Fix bug in gradio_web_server.py (lm-sys#3269) Register SmaugChatAdapter. (lm-sys#3243) update Code update (lm-sys#3194) Store Images Remotely on GCS (lm-sys#3172) format remove format update Add support for Smaug-2. (lm-sys#3211) ...
Signed-off-by: Harikrishnan Balagopal <[email protected]>
Signed-off-by: Harikrishnan Balagopal <[email protected]>
Signed-off-by: Harikrishnan Balagopal <[email protected]>
Why are these changes needed?
Support llama3. The code has been tested.
Related issue number (if applicable)
Checks
format.sh
to lint the changes in this PR.