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

Added support for URLs for Video, Audio, and Image #2256

Merged
merged 7 commits into from
Sep 14, 2022
Merged

Added support for URLs for Video, Audio, and Image #2256

merged 7 commits into from
Sep 14, 2022

Conversation

abidlabs
Copy link
Member

Previously, you could only pass in local filepaths for the Video and Audio components. This PR adds support for URLs as well.

Furthermore, while Image supported URLs for default values, examples with URLs didn't work. So this PR also fixes that.

Fixes: #2254

@github-actions
Copy link
Contributor

All the demos for this PR have been deployed at https://huggingface.co/spaces/gradio-pr-deploys/pr-2256-all-demos

@aliabd
Copy link
Collaborator

aliabd commented Sep 13, 2022

LGTM! Tested locally and works great :)

@abidlabs
Copy link
Member Author

Thanks for the review @aliabd! Just updated one of the example demos (reverse audio) to include an example URL.

Once the CI tests pass, I'll merge it in

@abidlabs abidlabs changed the title Added support to pass in URLs for Video, Audio, and Image Added support for URLs for Video, Audio, and Image Sep 14, 2022
@abidlabs abidlabs merged commit 809230f into main Sep 14, 2022
@abidlabs abidlabs deleted the ex-url branch September 14, 2022 00:24
@@ -14,7 +14,7 @@ def reverse_audio(audio):
inputs="microphone",
outputs="audio",
examples=[
os.path.join(os.path.dirname(__file__), "audio/cantina.wav"),
Copy link
Collaborator

@freddyaboulton freddyaboulton Sep 14, 2022

Choose a reason for hiding this comment

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

@abidlabs This doesn't work on spaces 😬

image

@abidlabs
Copy link
Member Author

@freddyaboulton it's working in the demos for this PR? https://huggingface.co/spaces/gradio-pr-deploys/pr-2256-all-demos

@abidlabs
Copy link
Member Author

Have you pulled in all of the changes from main into that branch?

@freddyaboulton
Copy link
Collaborator

@abidlabs Going to factory reboot the space to see if that fixes it. I think that branch had to have the latest changes from main right? Otherwise the reverse_audio wouldn't have the file URL introduced in this pr.

@abidlabs
Copy link
Member Author

Oh it looks like the file is no longer accessible! They probably have a timeout

@abidlabs
Copy link
Member Author

abidlabs commented Sep 14, 2022

Ideally we would use a file we're hosting ourselves, but for now can you replace with this one: https://samplelib.com/lib/preview/mp3/sample-3s.mp3

@freddyaboulton
Copy link
Collaborator

freddyaboulton commented Sep 14, 2022

@abidlabs Sounds good and thank you! Updated in this PR #2250.

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.

Adding an Image URL to examples doesn't render
3 participants