Gradio fn function errors right after 60 seconds
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 setenable_queueto True but that didn’t seem to change anything.Here’s how I launch:iface = gr.Interface(f, [
    "text",
    temperature,
    top_p,
    gr.inputs.Slider(
        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)
iface.launch(enable_queue=True)How can I prevent it timing out after 60 seconds every time the function takes long?^as soon as that reaches 60, it errors
2021-12-22T20:38:24Z
You can seeIs there a timeout (max runtime) for spaces? - #2 by Epochingorthe Gradio docs. You need to setenable_queuetoTruefor longer inferenceenable_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.
2021-12-22T21:44:04Z
yeah, key thing was I had to useenable=Truewithininterface(...), not within aninterface.launchcall.
2021-12-23T01:12:39Z
Yes, this is an issue that we’re dealing with (Investigateenable_queue· Issue #431 · gradio-app/gradio (github.com)). Thanks for bringing it to our attention.
2021-12-23T19:08:00Z
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
2021-12-24T20:44:32Z
I got it perthis comment, thanks
2023-06-21T09:36:58Z
“enable_queue = True” still works