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 gr.load to work inside gr.Blocks automatically #8579

Merged
merged 4 commits into from
Jun 20, 2024
Merged

Conversation

abidlabs
Copy link
Member

@abidlabs abidlabs commented Jun 19, 2024

Closes: #7996. Now both of these work:

import gradio as gr

gr.load("abidlabs/en2fr", src="spaces").launch()

and

import gradio as gr

with gr.Blocks() as demo:
    gr.load("abidlabs/en2fr", src="spaces")
    
demo.launch()

@gradio-pr-bot
Copy link
Collaborator

gradio-pr-bot commented Jun 19, 2024

🪼 branch checks and previews

Name Status URL
Spaces ready! Spaces preview
Website ready! Website preview
🦄 Changes detecting...

Install Gradio from this PR

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

Install Gradio Python Client from this PR

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

Install Gradio JS Client from this PR

npm install https://gradio-builds.s3.amazonaws.com/f125364646f03104d064c3766695f02533175c12/gradio-client-1.1.1.tgz

@gradio-pr-bot
Copy link
Collaborator

gradio-pr-bot commented Jun 19, 2024

🦄 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 gr.load to work inside gr.Blocks automatically

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 requested review from aliabid94 and aliabd June 19, 2024 19:57
Copy link
Collaborator

@aliabd aliabd left a comment

Choose a reason for hiding this comment

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

Tested and works great! Thanks @abidlabs

@abidlabs
Copy link
Member Author

Thanks @aliabd!

@abidlabs abidlabs merged commit bc5fccf into main Jun 20, 2024
7 checks passed
@abidlabs abidlabs deleted the load-in-blocks branch June 20, 2024 16:39
This was referenced Jun 20, 2024
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.

It is confusing to call render after gr.load
3 participants