Comments (10)
Hi @ploncker this is the intended behavior. When you do gr.load()
, Gradio reconstructs the demo for you locally using the UI components, styling, and version of the gradio
library that you have installed locally. However, the function calls are made to the remote Space. So if you are gr.load-ing a Space that has custom components, you'll need to install them locally as well.
from gradio.
Hi @abidlabs thanks for replying. I'm not hosting the demo locally. I'm trying to gr.load() a private space from a public one. Are you suggesting in this instance can I think of the public space as being equivalent to a local host?
If I import the gradio_pdf into my public space
'''
import os
import gradio as gr
from gradio_pdf import PDF
key = os.environ['MY_TOKEN']
demo = gr.load("ploncker/emma", hf_token=key, src="spaces")
demo.launch()
'''
then I end up with the following error when uploading a pdf file:
gradio_client.exceptions.AppError: The upstream Gradio app has raised an exception: [Errno 2] No such file or directory: '/tmp/gradio/b9c4e005bcfc18c805f30186061b14d3b0de3ed1/splunk-guide-to-operational-intelligence.pdf'
My guess is this happens because the the public space is using the public PDF component and uploading to somewhere in the public instance, the private app is expecting a file but never sees it, so throws the error. If thats correct how does one pass the file object to the private space with a custom component?
from gradio.
Hi @abidlabs thanks for replying. I'm not hosting the demo locally. I'm trying to gr.load() a private space from a public one. Are you suggesting in this instance can I think of the public space as being equivalent to a local host?
Correct
from gradio.
Regarding the error that you're seeing, can you confirm that both Spaces are using the latest versions of gradio
?
from gradio.
Public space logs: RUN pip install --no-cache-dir gradio[oauth]==4.37.2 "uvicorn>=0.14.0" spaces
Private space logs: RUN pip install --no-cache-dir gradio[oauth]==4.37.2 "uvicorn>=0.14.0" spaces
from gradio.
Hmm interesting, let me reopen and see if we can reproduce this on our end
from gradio.
Ok. Thanks for having a look.
Also just for clarity when the error says:
gradio_client.exceptions.AppError: The upstream Gradio app has raised an exception: [Errno 2] No such file or directory
Is the private space upstream or is the public space upstream?
I'm a bit confused in which takes precedence. Is it:
Private(equivalent to remote)-> Public(equivalent to local), ie Private upstream from Public, or is it the other way around?
from gradio.
The private / remote app is the one raising the exception here
from gradio.
I have kind of same issue here. I used gr.load() to load one of my private space into my public space, the whole UI is good, instead of the images and the svgs generated by the private space are not accessible inside the public space.
I can see from the browser internet that the public space was trying to access images from one tmp file of the private one, which I think it had been deleted.
I guess this is what happens:
- public-space:copied_functionA inside the gr.load() blocks has been called
- private-space:functionA runs and generate imageA remotely
- imageA has been preprocessed by gradio so it can be rendered in the browser, imageA becomes tmpImageA
- tmpImageA deleted since it is a tmp file?
- public-space try to fetch that tmp file which has been already deleted?
Are those steps correct? I feel like something wrong, and how to fix this?
Code in private-space For example:
with gr.Row(variant="panel"):
regenerate_btn.click(fn=generateImageA, inputs=[], outputs=[imageA])
from gradio.
I have kind of same issue here. I used gr.load() to load one of my private space into my public space, the whole UI is good, instead of the images and the svgs generated by the private space are not accessible inside the public space. I can see from the browser internet that the public space was trying to access images from one tmp file of the private one, which I think it had been deleted. I guess this is what happens:
- public-space:copied_functionA inside the gr.load() blocks has been called
- private-space:functionA runs and generate imageA remotely
- imageA has been preprocessed by gradio so it can be rendered in the browser, imageA becomes tmpImageA
- tmpImageA deleted since it is a tmp file?
- public-space try to fetch that tmp file which has been already deleted?
Are those steps correct? I feel like something wrong, and how to fix this?Code in private-space For example: with gr.Row(variant="panel"): regenerate_btn.click(fn=generateImageA, inputs=[], outputs=[imageA])
I'm sorry this is not what exactly happened.
It's just the tmp file path is 404 not found, I still have no clue about it
from gradio.
Related Issues (20)
- Invalid URL Error
- ChatBot component with layout="panel' shows chat bubbles and user utterance not left-aligned HOT 2
- multimodal chatbot custom component broken; normalise_file used in multimodal chatbot gone HOT 4
- Sharing in chatbot is broken
- Improve discoverability of share feature HOT 1
- Disable typing in Chatinterface textbox while Chatbot is generating
- Displaying examples inside the chatbot window
- In Chatbot component, how to close of the picture click to enlarge function
- how to got the login return user info in gradio to make a backend api command?
- Fix copied icon in gr.Code
- Grdio JSON component is not rendering dict object correctly
- Reload Mode not reloading changes from indirectly referenced modules
- `gr.Markdown` does not support adding a container around it HOT 1
- Multilingual on-screen Keyboard Component HOT 2
- Improving design consistency of Color Pickers HOT 1
- 504 Gateway time-out
- pyright error: Stub file not found for "gradio" HOT 1
- Use 100% Custom CSS for Gradio Components HOT 1
- [Regression] `cache_examples="lazy"` broken on `4.39.0` HOT 1
- Insufficient typing of event listener functions HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gradio.