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

Allow Gradio apps containing gr.Radio(), gr.Checkboxgroup(), or gr.Dropdown() to be loaded with gr.load() #5633

Merged
merged 10 commits into from
Sep 20, 2023

Conversation

abidlabs
Copy link
Member

@abidlabs abidlabs commented Sep 20, 2023

We allow these components to take in tuples of choices, but we when tuples are converted to javascript, they are converted to lists, so we need to handle that as well.

Test with:

import gradio as gr
demo = gr.load(name="abidlabs/test-radio", src="spaces")
demo.queue(api_open=False)
demo.launch()

Fixes: #5632

@gradio-pr-bot
Copy link
Contributor

gradio-pr-bot commented Sep 20, 2023

🪼 branch checks and previews

Name Status URL
Spaces ready! Spaces preview
Website ready! Website preview
Storybook ready! Storybook preview
Visual tests all good! Build review
🦄 Changes detected! Details

Install Gradio from this PR

pip install https://gradio-builds.s3.amazonaws.com/891ecda8caddbbf67012d3830392835d23aabf31/gradio-3.44.4-py3-none-any.whl

Install Gradio Python Client from this PR

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

@gradio-pr-bot
Copy link
Contributor

gradio-pr-bot commented Sep 20, 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.

Allow Gradio apps containing gr.Radio(), gr.Checkboxgroup(), or gr.Dropdown() to be loaded with gr.load()

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.

Nice! Looks good to me @abidlabs

@abidlabs
Copy link
Member Author

Thanks @freddyaboulton!

@abidlabs abidlabs merged commit 3414023 into main Sep 20, 2023
16 checks passed
@abidlabs abidlabs deleted the choices branch September 20, 2023 18:54
This was referenced Sep 20, 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.

Radio button broken when using gr.load() to load Huggingface space
3 participants