-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Conversation
🪼 branch checks and previews
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> |
🦄 change detectedThis Pull Request includes changes to the following packages.
With the following changelog entry.
Maintainers or the PR author can modify the PR title to modify this entry.
|
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.
thanks @freddyaboulton ! just left some small comments
js/chatbot/Index.svelte
Outdated
@@ -92,7 +92,7 @@ | |||
{min_height} | |||
{max_height} | |||
allow_overflow={true} | |||
flex={true} | |||
flex={visible} |
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.
minor but feel like this should be fixed at the Block.svelte level - if flex=true, but visible=false, the Block should be hidden
gradio/components/chatbot.py
Outdated
@@ -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 |
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.
seems like self explanatory code,, comment is unnecessary imo
.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; | ||
} |
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.
why is this css necessary? seemed to work fine before
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 @aliabid94 !! |
Description
Closes #9366
Closes #9724
Also the image preview button styling was messed up. I aligned it with the other icon buttons.
🎯 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
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
You may need to run the linters:
bash scripts/format_backend.sh
andbash scripts/format_frontend.sh