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

Ensure undo/try shows for final bot message in gr.Chatbot #9600

Merged
merged 12 commits into from
Oct 9, 2024

Conversation

hannahblair
Copy link
Collaborator

@hannahblair hannahblair commented Oct 9, 2024

Description

The retryable and undoable props weren't reactive and thus weren't updating when new messages came in. This PR fixes that.

Screenshot 2024-10-09 at 01 27 40

Closes: #9588

🎯 PRs Should Target Issues

Before your create a PR, please check to see if there is an existing issue for this change. If not, please create an issue before you create this PR, unless the fix is very small.

Not adhering to this guideline will result in the PR being closed.

Tests

  1. PRs will only be merged if tests pass on CI. To run the tests locally, please set up your Gradio environment locally and run the tests: bash scripts/run_all_tests.sh

  2. You may need to run the linters: bash scripts/format_backend.sh and bash scripts/format_frontend.sh

@hannahblair hannahblair changed the base branch from main to 5.0-dev October 9, 2024 00:28
@gradio-pr-bot
Copy link
Collaborator

gradio-pr-bot commented Oct 9, 2024

🪼 branch checks and previews

Name Status URL
Spaces ready! Spaces preview
Storybook ready! Storybook preview
🦄 Changes detected! Details

Install Gradio from this PR

pip install https://gradio-pypi-previews.s3.amazonaws.com/8c19f692c07d9fdad87a05b276e63b8306409fd6/gradio-4.44.1-py3-none-any.whl

Install Gradio Python Client from this PR

pip install "gradio-client @ git+https://github.com/gradio-app/gradio@8c19f692c07d9fdad87a05b276e63b8306409fd6#subdirectory=client/python"

Install Gradio JS Client from this PR

npm install https://gradio-npm-previews.s3.amazonaws.com/8c19f692c07d9fdad87a05b276e63b8306409fd6/gradio-client-1.6.0-beta.4.tgz

Use Lite from this PR

<script type="module" src="https://gradio-lite-previews.s3.amazonaws.com/8c19f692c07d9fdad87a05b276e63b8306409fd6/dist/lite.js""></script>

@gradio-pr-bot
Copy link
Collaborator

gradio-pr-bot commented Oct 9, 2024

🦄 change detected

This Pull Request includes changes to the following packages.

Package Version
@gradio/chatbot patch
gradio patch
  • Maintainers can select this checkbox to manually select packages to update.

With the following changelog entry.

Ensure undo/try shows for final bot message in gr.Chatbot

Maintainers or the PR author can modify the PR title to modify this entry.

Something isn't right?

  • Maintainers can change the version label to modify the version bump.
  • If the bot has failed to detect any changes, or if this pull request needs to update multiple packages to different versions or requires a more comprehensive changelog entry, maintainers can update the changelog file directly.

Copy link
Collaborator

@freddyaboulton freddyaboulton left a comment

Choose a reason for hiding this comment

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

Functionality looks good @hannahblair !!

At least in spaces though the color of the retry button and copy button is white which means it does not show up. Is it a mobile/spaces issue or can you repro locally?

https://huggingface.co/spaces/freddyaboulton/chatinterface_streaming_echo

image

@hannahblair
Copy link
Collaborator Author

hannahblair commented Oct 9, 2024

Thanks for reviewing!

Thats odd, I can't see that the space myself 🤔 Are you sure the page was fully loaded?
Screenshot 2024-10-09 at 01 59 47

Copy link
Member

@abidlabs abidlabs left a comment

Choose a reason for hiding this comment

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

This isn't working for me, when I run demo/chatinterface_streaming_echo/run.py, I see the following error in the console preventing usage of the app:

image

@aliabid94
Copy link
Collaborator

I got the same error as @abidlabs

@aliabid94
Copy link
Collaborator

aliabid94 commented Oct 9, 2024

I fixed it

Copy link
Collaborator

@aliabid94 aliabid94 left a comment

Choose a reason for hiding this comment

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

LGTM as well!

@abidlabs
Copy link
Member

abidlabs commented Oct 9, 2024

Merging!

@abidlabs abidlabs merged commit 9f71086 into 5.0-dev Oct 9, 2024
21 of 25 checks passed
@abidlabs abidlabs deleted the undo-retry-chatbot branch October 9, 2024 04:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ensure that retry/undo buttons only show up in the most recent message in gr.Chatbot in panel mode
5 participants