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

Processes avatar_images for gr.Chatbot and icon for gr.Button correctly, so that respective files are moved to cache #6379

Merged
merged 15 commits into from Nov 12, 2023

Conversation

abidlabs
Copy link
Member

@abidlabs abidlabs commented Nov 11, 2023

Closes: #6329

Test with chatbot_multimodal demo

@gradio-pr-bot
Copy link
Contributor

gradio-pr-bot commented Nov 11, 2023

🪼 branch checks and previews

Name Status URL
Spaces ready! Spaces preview
Website ready! Website preview
🦄 Changes detected! Details
📓 Notebooks matching!

Install Gradio from this PR

pip install https://gradio-builds.s3.amazonaws.com/0ffd4d0a1e2e190ad33810af31f3947f7b49dbc1/gradio-4.2.0-py3-none-any.whl

Install Gradio Python Client from this PR

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

@gradio-pr-bot
Copy link
Contributor

gradio-pr-bot commented Nov 11, 2023

🦄 change detected

This Pull Request includes changes to the following packages.

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

With the following changelog entry.

Processes avatar_images for gr.Chatbot and icon for gr.Button correctly, so that respective files are moved to cache

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.

@abidlabs abidlabs changed the title Processes avatar_images for gr.Chatbot and linkfor gr.Button correctly, so that respective files are moved to cache Processes avatar_images for gr.Chatbot and icon for gr.Button correctly, so that respective files are moved to cache Nov 11, 2023
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. Seems like it would be cleaner to move move_resource_to_block_cache to be a Block method, instead of having to pass self everywhere it's called.

@abidlabs
Copy link
Member Author

Thanks @aliabid94. That's a good idea, I'll make the change

@abidlabs
Copy link
Member Author

I'll refactor it so that the Block class has its own move_resource_to_block_cache() instance method, but I'll also leave the original move_resource_to_block_cache method in postprocessing_utils.py for backwards compatibility for any custom components created in Gradio 4.2.0 or earlier.

@aliabid94
Copy link
Collaborator

I'll also leave the original move_resource_to_block_cache method in postprocessing_utils.py for backwards compatibility

Then have postprocessing_utils.move_resource_to_block_cache just call the block.move_resource_to_block_cache?

@abidlabs
Copy link
Member Author

Made the refactor, and then also included a test using the gradio_pdf custom component that @freddyaboulton created to ensure backwards compatibility. Will merge after CI is green. Thanks for the review @aliabid94!

@abidlabs abidlabs merged commit de998b2 into main Nov 12, 2023
17 checks passed
@abidlabs abidlabs deleted the fix-file-processing branch November 12, 2023 07:13
@pngwn pngwn mentioned this pull request Nov 11, 2023
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.

Chatbot avatar image not loading in chatbot_multimodal demo
3 participants