-
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
mount_gradio_app causing reload loop #2427
Comments
It also does this whenever you run The dev mode functionality should be implemented with websockets rather than polling in this manner. |
To close this issue, I think we need to make sure Reimplementing dev mode to not reload the page should be left to another issue. |
Hey @freddyaboulton , thanks, I had just tracked it down when you commented. I agree with the suggested fix, especially since the behaviour is bizarre and difficult to track down. For now, some updates to the docs might also be helpful. Thanks again! |
I am still having this isse. app = FastAPI()
gradio_interface = gr.Interface(...)
gradio_app = gr.routes.App.create_app(gradio_interface)
app.mount("/", gradio_app)
uvicorn.run(app, host="0.0.0.0", port=7000) As soon as I open the page my logs are filled with:
Can you please tell me how to stop that behavior? I use gradio >=3.14.0 Edit:
|
Hi @DieseKartoffel ! Your workaround does work but you also don't need to manually run See https://github.com/gradio-app/gradio/blob/main/demo/custom_path/run.py |
I'm also getting this issue, but only on windows. It loops when calling functions from instantiated objects from other local files with the respective classes. |
@freddyaboulton The However, I found it doesn't work to just set This is confusing and takes me half an hour to figure it out. So I have 2 suggestions for improvement:
Look forward to your opinion and I'm glad to make PR if needed :) |
Describe the bug
Hello. I'm trying to run some apps using mount_gradio_app. When I go to that page it loads perfectly, but is stuck in a reload loop. In the network tab of the console the
/app_id
call is being made every ~500ms, it succeeds, gets the same ID returned, but keeps going.I have a simple page showing at
/
(read_main
) and this works correctly. It is only the sub-APIs that have the reload-loop issue.Int eh example below
/
has no issues, but/words
(and any other sub API I try) gets caught in this loop.Any help greatly appreciated. This is for an internal demo that won't be accessible on the internet (But will be hosted in k8s on an internal VPN), so it doesn't need to be full prod ready.
Is there an existing issue for this?
Reproduction
Here's a simple version:
main.py:
Dockerfile
nginx
I'm running the app now with
uvicorn main:app
but I've tried lots of options, tried it programmatically with reload set explicitly to false, and through Gunicorn and a socket. None of these solve the problem.Screenshot
Logs
Severity
blocking all usage of gradio
The text was updated successfully, but these errors were encountered: