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

chat in browser #242

Merged
merged 8 commits into from
Apr 19, 2024
Merged

chat in browser #242

merged 8 commits into from
Apr 19, 2024

Conversation

Olivia-liu
Copy link
Contributor

@Olivia-liu Olivia-liu commented Apr 17, 2024

Do the regular torchchat setup, then in torchchat dir, run:
python torchchat.py browser --device cpu --checkpoint-path ${MODEL_PATH} --temperature 0 --num-samples 10
Then you would see * Running on http://127.0.0.1:5000 printed out on terminal. Click the link or go to http://127.0.0.1:5000 on your browser to start interacting with it.
Screenshot 2024-04-18 at 7 13 23 PM

You can also run the flask app directly (to debug, e.g.):
flask --app 'chat_in_browser:create_app("--device", "cpu", "--checkpoint-path", "checkpoints/stories15M/stories15M.pt", "--temperature", "0", "--chat", "--num-samples", "10")' run

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Meta Open Source bot. label Apr 17, 2024
Copy link
Contributor

@mikekgfb mikekgfb left a comment

Choose a reason for hiding this comment

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

Thank you!

@Olivia-liu Olivia-liu changed the title WIP chat in browser chat in browser Apr 19, 2024
Copy link
Contributor

@mikekgfb mikekgfb left a comment

Choose a reason for hiding this comment

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

Thank you!

@Olivia-liu Olivia-liu merged commit ee0f545 into main Apr 19, 2024
17 checks passed
@mikekgfb mikekgfb deleted the chat_in_browser branch April 19, 2024 02:13
# TODO: add check_args()

# Assume the user wants "chat" when entering "browser". TODO: add support for "generate" as well
args_plus_chat = ['"{}"'.format(s) for s in sys.argv[2:]] + ["\"--chat\""]
Copy link
Contributor

Choose a reason for hiding this comment

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

you can use ["'--chat'"] to avoid escapes.

malfet pushed a commit that referenced this pull request Jul 17, 2024
* chat in browser

* remove jinja2 comment seems irrelavant

* remove jinja2 comment seems irrelavant

* remove debug prints

* use torchchat as entry point
malfet pushed a commit that referenced this pull request Jul 17, 2024
* chat in browser

* remove jinja2 comment seems irrelavant

* remove jinja2 comment seems irrelavant

* remove debug prints

* use torchchat as entry point
malfet pushed a commit that referenced this pull request Jul 17, 2024
* chat in browser

* remove jinja2 comment seems irrelavant

* remove jinja2 comment seems irrelavant

* remove debug prints

* use torchchat as entry point
malfet pushed a commit that referenced this pull request Jul 17, 2024
* chat in browser

* remove jinja2 comment seems irrelavant

* remove jinja2 comment seems irrelavant

* remove debug prints

* use torchchat as entry point
malfet pushed a commit that referenced this pull request Jul 17, 2024
* chat in browser

* remove jinja2 comment seems irrelavant

* remove jinja2 comment seems irrelavant

* remove debug prints

* use torchchat as entry point
malfet pushed a commit that referenced this pull request Jul 17, 2024
* chat in browser

* remove jinja2 comment seems irrelavant

* remove jinja2 comment seems irrelavant

* remove debug prints

* use torchchat as entry point
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