-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
More fixes for gr.load() #7376
More fixes for gr.load() #7376
Conversation
🪼 branch checks and previews
Install Gradio from this PR pip install https://gradio-builds.s3.amazonaws.com/ae372689f1e00f49323e9b1eea8cfbd4fb6c3b0a/gradio-4.19.2-py3-none-any.whl Install Gradio Python Client from this PR pip install "gradio-client @ git+https://github.com/gradio-app/gradio@ae372689f1e00f49323e9b1eea8cfbd4fb6c3b0a#subdirectory=client/python" |
🦄 change detectedThis Pull Request includes changes to the following packages.
With the following changelog entry.
Maintainers or the PR author can modify the PR title to modify this entry.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good @abidlabs but had two questions/comments!
temp_file_path = processing_utils.save_file_to_cache( | ||
url_or_file_path, cache_dir=self.GRADIO_CACHE | ||
) | ||
try: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This makes sense but I think we're not covering the case where the value of the component is a file on the space.
I loaded the following demo
gr.load("gradio/image_mod_default_image", src="spaces").launch()
And this is what I see

From the console
file-url.ts:12 Uncaught (in promise) TypeError: Failed to construct 'URL': Invalid URL
at should_proxy_wasm_src (file-url.ts:12:14)
at resolve_wasm_src (file-url.ts:26:22)
at $$self.$$.update (Image.svelte:28:3)
at init (svelte.js:3246:5)
at new Image (Image.svelte:30:21)
at create_if_block (Example-9a0e0dba.js:29:10)
at create_fragment (Example.svelte:19:39)
at init (svelte.js:3250:34)
at new Example (Example.svelte:8:29)
at construct_svelte_component (svelte.js:1613:9)
and
GET http://127.0.0.1:7861/proxy=https://gradio-image-mod-default-image.hf.space/file=undefined 403 (Forbidden)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm okay I'll look at this more closely on Monday, thanks for catching this @freddyaboulton
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I actually can't repro this issue, the Space loads for me:

I do have an issue when actually trying to run the app, but that also will be tackled as part of #7360
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is related to #7360 actually.
The function server returns the right path but the issue is that the FileData
object is wrapped in a list -

I think this may be because of the change to reduce_singleton_output
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll take a look!
Hello @abidlabs, I've gone through all the issues and installed the latest gradio and gradio-client libraries but still getting the same error while trying to load one space from another. Output below. Any advice? Thanks, Alexandre Fetching Space from: https://huggingface.co/spaces/avfranco/ArchitectGPT { File ~/.pyenv/versions/3.11.3/envs/huggingface/lib/python3.11/site-packages/gradio/external.py:60, in load(name, src, hf_token, alias, **kwargs) File ~/.pyenv/versions/3.11.3/envs/huggingface/lib/python3.11/site-packages/gradio/external.py:99, in load_blocks_from_repo(name, src, hf_token, alias, **kwargs) File ~/.pyenv/versions/3.11.3/envs/huggingface/lib/python3.11/site-packages/gradio/external.py:417, in from_spaces(space_name, hf_token, alias, **kwargs) File ~/.pyenv/versions/3.11.3/envs/huggingface/lib/python3.11/site-packages/gradio/external.py:440, in from_spaces_blocks(space, hf_token) File ~/.pyenv/versions/3.11.3/envs/huggingface/lib/python3.11/site-packages/gradio/blocks.py:729, in Blocks.from_config(cls, config, fns, proxy_url) File ~/.pyenv/versions/3.11.3/envs/huggingface/lib/python3.11/site-packages/gradio/blocks.py:731, in (.0) KeyError: None" |
Hi @avfranco-br can you share a public Space with me? |
Thanks for reviewing @freddyaboulton, I think this can be merged in as a partial fix for #7362 |
Thanks @abidlabs for your quick response. Sure, here it's ea4all_gpt. |
Thanks @avfranco-br yes so the error you're getting is the one that this PR should fix. If you'd like to try it, you can build Gradio from this PR in your Space. I've opened a PR for your Space here: https://huggingface.co/spaces/avfranco/ea4all_gpt/discussions/1 |
Thanks @abidlabs, I've installed Gradio from both PRs below, but the error still persists. Shall I do something else? |
Closing as I'll do this as part of #7575 |
So this is a partial fix to: #7362
This PR allows these two Spaces to be loaded at least. They won't work yet (will tackle that next)
and partially fixes the first one:
These demos will load but if you try running them you'll get errors. As far as I can tell, this has to do with the fact that the logic for gathering/uploading files is incorrect. So I'll tackle that separately in #7360