Skip to content

fix run chat #482

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

Merged
merged 1 commit into from
Apr 25, 2024
Merged

fix run chat #482

merged 1 commit into from
Apr 25, 2024

Conversation

metascroy
Copy link
Contributor

@metascroy metascroy commented Apr 25, 2024

The BPE tokenizer does not pattern match the special SOS and EOS tokens and they must be explicitly added with the encode function's 2nd and 3rd arguments.

Sample output after change:

(cchat2) scroy@scroy-mbp torchchat % ./cmake-out/aoti_run ./model.so -z ./.model-artifacts/meta-llama/Llama-2-7b-chat-hf/tokenizer.bin -m chat -t 0
Failed to load ./.model-artifacts/meta-llama/Llama-2-7b-chat-hf/tokenizer.bin into a Tiktoken tokenizer. Trying sentencepiece tokenizer..
Enter system prompt (optional): Be brief.  Answer in 10 words or less.
User: What is the answer to the universe?
Assistant:   The answer to the universe is 42.
User: Why did you say that?
Assistant:   I'm just joking! The answer to the universe is not actually 42. It's a humorous reference to a popular meme and book series called "The Hitchhiker's Guide to the Galaxy." In the series, the character Deep Thought, a supercomputer, is asked to find the answer to the universe, and after 7.5 million years of calculation, it finally reveals that the answer is 42. However, the character explains that the answer is meaningless and that the true answer is "42!"
User: Interesting.  Who wrote that?
Assistant:   The Hitchhiker's Guide to the Galaxy is a series of books written by Douglas Adams. The series includes five books: "The Hitchhiker's Guide to the Galaxy," "Restaurant at the End of the Un

@metascroy metascroy requested a review from larryliu0820 April 25, 2024 15:37
@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Meta Open Source bot. label Apr 25, 2024
@metascroy metascroy requested a review from JacobSzwejbka April 25, 2024 15:40
@mikekgfb
Copy link
Contributor

LGTM - @JacobSzwejbka please review as a second set of eyes since you're our expert on chat!

@mikekgfb
Copy link
Contributor

Thank you! Waiting to get Jacob's feedback too, to ensure that generate --chat and runner are aligned

@mikekgfb mikekgfb merged commit 063df07 into main Apr 25, 2024
@malfet malfet deleted the fix-run-chat branch April 30, 2024 16:51
malfet pushed a commit that referenced this pull request Jul 17, 2024
malfet pushed a commit that referenced this pull request Jul 17, 2024
malfet pushed a commit that referenced this pull request Jul 17, 2024
malfet pushed a commit that referenced this pull request Jul 17, 2024
malfet pushed a commit that referenced this pull request Jul 17, 2024
malfet pushed a commit that referenced this pull request Jul 17, 2024
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.

4 participants