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

Fix chatbot component streaming bug and visible bug #9730

Merged
merged 9 commits into from
Oct 17, 2024

Conversation

freddyaboulton
Copy link
Collaborator

@freddyaboulton freddyaboulton commented Oct 16, 2024

Description

Closes #9366
Closes #9724

Also the image preview button styling was messed up. I aligned it with the other icon buttons.

image

🎯 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

@gradio-pr-bot
Copy link
Collaborator

gradio-pr-bot commented Oct 16, 2024

🪼 branch checks and previews

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

Install Gradio from this PR

pip install https://gradio-pypi-previews.s3.amazonaws.com/ded734af863bd4da29badae154373a2975820011/gradio-5.2.0-py3-none-any.whl

Install Gradio Python Client from this PR

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

Install Gradio JS Client from this PR

npm install https://gradio-npm-previews.s3.amazonaws.com/ded734af863bd4da29badae154373a2975820011/gradio-client-1.7.0.tgz

Use Lite from this PR

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

@gradio-pr-bot
Copy link
Collaborator

gradio-pr-bot commented Oct 16, 2024

🦄 change detected

This Pull Request includes changes to the following packages.

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

With the following changelog entry.

Fix chatbot component streaming bug and visible bug

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.

@freddyaboulton freddyaboulton changed the title Fix chatbot component streaming bug Fix chatbot component streaming bug and visible bug Oct 16, 2024
@freddyaboulton freddyaboulton marked this pull request as ready for review October 16, 2024 20:20
@freddyaboulton freddyaboulton requested review from pngwn, abidlabs, aliabid94, dawoodkhan82 and hannahblair and removed request for pngwn October 16, 2024 20:20
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.

thanks @freddyaboulton ! just left some small comments

@@ -92,7 +92,7 @@
{min_height}
{max_height}
allow_overflow={true}
flex={true}
flex={visible}
Copy link
Collaborator

Choose a reason for hiding this comment

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

minor but feel like this should be fixed at the Block.svelte level - if flex=true, but visible=false, the Block should be hidden

@@ -447,6 +448,9 @@ def _postprocess_content(
return chat_message
elif isinstance(chat_message, FileData):
return FileMessage(file=chat_message)
elif isinstance(chat_message, ComponentMessage):
# in the case where components are part of a streaming response
Copy link
Collaborator

Choose a reason for hiding this comment

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

seems like self explanatory code,, comment is unnecessary imo

Comment on lines +600 to +612
.image-preview {
position: absolute;
z-index: 999;
left: 0;
top: 0;
width: 100%;
height: 100%;
overflow: auto;
background-color: var(--background-fill-secondary);
display: flex;
justify-content: center;
align-items: center;
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

why is this css necessary? seemed to work fine before

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is only needed for the full-screen image preview. Otherwise when you click on an image to pull up the full screen view it will be messed up

image

@freddyaboulton
Copy link
Collaborator Author

Thank you @aliabid94 !!

@freddyaboulton freddyaboulton merged commit 39a0e8c into main Oct 17, 2024
18 of 22 checks passed
@freddyaboulton freddyaboulton deleted the chatbot-component-streaming branch October 17, 2024 00:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants