-
Notifications
You must be signed in to change notification settings - Fork 231
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
chat in browser #242
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.
Thank you!
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.
Thank you!
# 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\""] |
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.
you can use ["'--chat'"]
to avoid escapes.
* chat in browser * remove jinja2 comment seems irrelavant * remove jinja2 comment seems irrelavant * remove debug prints * use torchchat as entry point
* chat in browser * remove jinja2 comment seems irrelavant * remove jinja2 comment seems irrelavant * remove debug prints * use torchchat as entry point
* chat in browser * remove jinja2 comment seems irrelavant * remove jinja2 comment seems irrelavant * remove debug prints * use torchchat as entry point
* chat in browser * remove jinja2 comment seems irrelavant * remove jinja2 comment seems irrelavant * remove debug prints * use torchchat as entry point
* chat in browser * remove jinja2 comment seems irrelavant * remove jinja2 comment seems irrelavant * remove debug prints * use torchchat as entry point
* chat in browser * remove jinja2 comment seems irrelavant * remove jinja2 comment seems irrelavant * remove debug prints * use torchchat as entry point
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.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