Open nahuaque opened 2 months ago
Judging from the screenshot, are you using AWS? In my case, I'm not using AWS but a rented server, but I had a similar problem. I fixed it by changing it so that nginx didn't buffer. I hope this helps you a little.
import gradio as gr
import time
def greet(progress=gr.Progress()):
progress(0, desc="Starting...")
time.sleep(1)
for i in progress.tqdm(range(40)):
time.sleep(0.1)
return "Complete!"
if __name__ == '__main__':
with gr.Blocks() as demo:
execute_button = gr.Button("Run")
output_progress = gr.TextArea(label="progress")
execute_button.click(greet, outputs=output_progress)
demo.launch(root_path="/my_root_path")
The progress bar is shown correctly.
location /my_root_path/ {
proxy_pass http://127.0.0.1:7860/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_buffering off;
proxy_cache off;
chunked_transfer_encoding on;
}
The Text "Starting" and progress bar is not shown, but the last text "Complete" is shown after a few seconds.
location /my_root_path/ {
proxy_pass http://127.0.0.1:7860/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
#proxy_buffering off;
#proxy_cache off;
#chunked_transfer_encoding on;
}
Describe the bug
The Gradio custom progress bar does not display when launching the demo with a custom root_path. Instead I get only a spinner.
In Chrome Developer, I can see that there is an issue with loading one CSS asset, where it's incorrectly using the absolute path, i.e. not prefixed with the custom root path. The other assets all seem to be ok.
The bar does however display when the root path is not set.
Have you searched existing issues? 🔎
Reproduction
Screenshot
Logs
No response
System Info
Severity
Blocking usage of gradio