-
Notifications
You must be signed in to change notification settings - Fork 250
Replace browser UI with Basic Streamlit UI Implementation #908
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
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/torchchat/908
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit f24f79d with merge base b0081ed ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
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.
one minor change
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.
Varun and I walked through the updates to the outstanding comments; latest version looks good
Introduces basic Python dataclasses to represent requests, responses, and associated objects defined in the OpenAI API specification. This will enable creating a basic server that follows the spec so users can leverage TorchChat to run LLMs on their own hardware with a familiar interface to existing cloud tools. **Testing** Lintunner ``` lintrunner Warning: Could not find a lintrunner config at: '.lintrunner.private.toml'. Continuing without using configuration file. >>> Lint for generate.py: Advice (FLAKE8) C901 'Generator.chat' is too complex (32) See https://www.flake8rules.com/rules/C901.html. 581 | buffer.clear() 582 | # print(, end='', flush=True) 583 | >>> 584 | def chat( 585 | self, 586 | generator_args: GeneratorArgs, 587 | ): ``` (advice from prior commit) Dataclasses are used and tested further in PR #908
Introduces basic Python dataclasses to represent requests, responses, and associated objects defined in the OpenAI API specification. This will enable creating a basic server that follows the spec so users can leverage TorchChat to run LLMs on their own hardware with a familiar interface to existing cloud tools. **Testing** Lintunner ``` lintrunner Warning: Could not find a lintrunner config at: '.lintrunner.private.toml'. Continuing without using configuration file. >>> Lint for generate.py: Advice (FLAKE8) C901 'Generator.chat' is too complex (32) See https://www.flake8rules.com/rules/C901.html. 581 | buffer.clear() 582 | # print(, end='', flush=True) 583 | >>> 584 | def chat( 585 | self, 586 | generator_args: GeneratorArgs, 587 | ): ``` (advice from prior commit) Dataclasses are used and tested further in PR #908
Introduces basic Python dataclasses to represent requests, responses, and associated objects defined in the OpenAI API specification. This will enable creating a basic server that follows the spec so users can leverage TorchChat to run LLMs on their own hardware with a familiar interface to existing cloud tools. **Testing** Lintunner ``` lintrunner Warning: Could not find a lintrunner config at: '.lintrunner.private.toml'. Continuing without using configuration file. >>> Lint for generate.py: Advice (FLAKE8) C901 'Generator.chat' is too complex (32) See https://www.flake8rules.com/rules/C901.html. 581 | buffer.clear() 582 | # print(, end='', flush=True) 583 | >>> 584 | def chat( 585 | self, 586 | generator_args: GeneratorArgs, 587 | ): ``` (advice from prior commit) Dataclasses are used and tested further in PR #908
Remove the existing browser UI and replace it with a UI built with Streamlit. This reduces complexity & leverages the functionality introduced in PR #906 to display chunked responses. **Testing** ``` streamlit run torchchat.py -- browser stories110M --compile --max-new-tokens 256 You can now view your Streamlit app in your browser. Local URL: http://localhost:8501 Network URL: http://192.0.0.2:8501 ``` <img width="1002" alt="image" src="https://github.com/user-attachments/assets/df305943-2326-4d01-a48b-61dd2006fa28">
(3/3) Split #875 into separate PRs.
Remove the existing browser UI and replace it with a UI built with Streamlit. This reduces complexity & leverages the functionality introduced in PR #906 to display chunked responses.
Testing
Stack from ghstack (oldest at bottom):