Always exactly after 60 seconds since execution, the function I pass to gradio.interface errors, and in the web console I get a JSON parsing error. I set
enable_queue to True but that didn’t seem to change anything.
Here’s how I launch:
iface = gr.Interface(f, [
minimum=20, maximum=512, default=30, label="max length"),
gr.inputs.Dropdown(["GPT-J-6B", "GPT-2"], type="index", label="model"),
gr.inputs.Textbox(lines=1, placeholder="xxxxxxxx", label="space verification key")
], outputs="text", title=title, examples=examples)
How can I prevent it timing out after 60 seconds every time the function takes long?
^as soon as that reaches 60, it errors
You can see Is there a timeout (max runtime) for spaces? - #2 by Epoching or the Gradio docs. You need to set
True for longer inference
- enable_queue (bool) - if True, inference requests will be served through a queue instead of with parallel threads. Required for longer inference times (> 1min) to prevent timeout.
yeah, key thing was I had to use
interface(...), not within an
Yes, this is an issue that we’re dealing with (Investigate
enable_queue · Issue #431 · gradio-app/gradio (github.com)). Thanks for bringing it to our attention.
As of the latest version of Gradio (
2.6.0), this should be fixed. But please let me know if you still are running into issues @un-index
I got it per this comment, thanks