gradio-app / gradio

Build and share delightful machine learning apps, all in Python. 🌟 Star to support our work!
http://www.gradio.app
Apache License 2.0
30.73k stars 2.29k forks source link

Click to preview images in chatbot #8377

Closed dawoodkhan82 closed 1 month ago

dawoodkhan82 commented 1 month ago

Description

(Re-opened a new PR for this feature and branched off main) Click to preview images in chatbot

Closes: N/A

🎯 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 commented 1 month ago

🪼 branch checks and previews

• Name Status URL
Spaces ready! Spaces preview
Website building...
Storybook ready! Storybook preview
:unicorn: Changes detecting...

Install Gradio from this PR

pip install https://gradio-builds.s3.amazonaws.com/ca0a2167cfc2e9e579767434e8804e60b2d8af18/gradio-4.32.2-py3-none-any.whl

Install Gradio Python Client from this PR

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

Install Gradio JS Client from this PR

npm install https://gradio-builds.s3.amazonaws.com/ca0a2167cfc2e9e579767434e8804e60b2d8af18/gradio-client-0.20.1.tgz
gradio-pr-bot commented 1 month ago

🦄 change detected

This Pull Request includes changes to the following packages.

Package Version
@gradio/chatbot patch
@gradio/multimodaltextbox patch
gradio patch

With the following changelog entry.

Click to preview images in 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](https://github.com/gradio-app/gradio/edit/image-preview/.changeset/dirty-wings-double.md).
abidlabs commented 1 month ago

Correct me if I'm wrong, but this is still in draft state, right @dawoodkhan82? I tested the chatbot_multimodal demo on the deployed PR and it is not working.

dawoodkhan82 commented 1 month ago

@abidlabs Works fine for me. Are you clicking on the image in the chatbot to open the preview?

abidlabs commented 1 month ago

Is the chatinterface_multimodal in the deployed Space PR working for you? Weirdly images work, but not regular text:

https://github.com/gradio-app/gradio/assets/1778297/5813aded-2b51-40e8-9299-22ac445194d6

dawoodkhan82 commented 1 month ago

Oh I see, I thought you meant the preview didn't work. I'll push a fix

dawoodkhan82 commented 1 month ago

@abidlabs Can I get a re-review?

abidlabs commented 1 month ago

Thanks @dawoodkhan82 the chatinterface_multimodal demo is working now, but the image preview feature is not working completely. The issue I'm seeing is that that if you upload multiple images into that demo, and then click on any of the images, you'll always get the image preview of the final image

https://github.com/gradio-app/gradio/assets/1778297/144a9137-a561-4dd6-a6b2-835c41e8ed60

dawoodkhan82 commented 1 month ago

@abidlabs should be fixed now

abidlabs commented 1 month ago

Now I'm seeing some weird shifting issues happening in chatinterface_multimodal:

https://github.com/gradio-app/gradio/assets/1778297/ccb298ca-b0b5-408a-80c3-71df0ed8d585

dawoodkhan82 commented 1 month ago

That must've been caused by the other chatbot spacing PR. Just pushed a fix for it now.

abidlabs commented 1 month ago

Image preview looks great, thanks @dawoodkhan82! As mentioned in DM, there's a weird issue with placeholder popping back and forth but seems unrelated to this PR.

https://github.com/gradio-app/gradio/assets/1778297/9480e463-4706-452b-85b2-62e052f11842