Skip to content

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

Merged
merged 1 commit into from
Jul 18, 2024

Conversation

vmpuri
Copy link
Contributor

@vmpuri vmpuri commented Jul 16, 2024

(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

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
image

Stack from ghstack (oldest at bottom):

Copy link

pytorch-bot bot commented Jul 16, 2024

🔗 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 Failures

As of commit f24f79d with merge base b0081ed (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

vmpuri pushed a commit that referenced this pull request Jul 16, 2024
@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Meta Open Source bot. label Jul 16, 2024
@dbort dbort self-requested a review July 16, 2024 17:44
byjlw
byjlw previously requested changes Jul 16, 2024
Copy link
Contributor

@byjlw byjlw left a comment

Choose a reason for hiding this comment

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

one minor change

vmpuri pushed a commit that referenced this pull request Jul 16, 2024
vmpuri pushed a commit that referenced this pull request Jul 16, 2024
vmpuri pushed a commit that referenced this pull request Jul 16, 2024
vmpuri pushed a commit that referenced this pull request Jul 16, 2024
@dbort dbort requested a review from byjlw July 17, 2024 00:01
Copy link
Contributor

@dbort dbort left a 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

vmpuri pushed a commit that referenced this pull request Jul 17, 2024
vmpuri pushed a commit that referenced this pull request Jul 17, 2024
malfet pushed a commit that referenced this pull request Jul 17, 2024
vmpuri pushed a commit that referenced this pull request Jul 17, 2024
vmpuri pushed a commit that referenced this pull request Jul 17, 2024
dbort pushed a commit that referenced this pull request Jul 17, 2024
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
dbort pushed a commit that referenced this pull request Jul 17, 2024
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
@dbort dbort force-pushed the gh/vmpuri/3/head branch from 107da74 to 3f3fe8e Compare July 17, 2024 23:13
@dbort dbort changed the base branch from gh/vmpuri/3/base to gh/vmpuri/2/head July 17, 2024 23:13
dbort pushed a commit that referenced this pull request Jul 17, 2024
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
Base automatically changed from gh/vmpuri/2/head to main July 17, 2024 23:57
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">
@dbort dbort force-pushed the gh/vmpuri/3/head branch from 3f3fe8e to f24f79d Compare July 17, 2024 23:57
@dbort dbort dismissed byjlw’s stale review July 18, 2024 00:02

Requests resolved

@dbort dbort merged commit 3e71b61 into main Jul 18, 2024
51 checks passed
@dbort dbort deleted the gh/vmpuri/3/head branch July 18, 2024 00:53
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.

5 participants