I have a space which loads and runs a process to 12 different models at the same time using Gradio.Interface.load(). It works great unless 1 model fails to complete its job, or error out. Sometimes one or more models seem to just get stuck processing for eternity, and the queue then fills up with these processes, blocking any others.
I’m wondering if there is a way to cancel the process after a certain time, say 2 minutes, display an error message, and move on.
This is how I’m loading the models.
proc1=gr.Interface.load(f"models/{model_1}",live=False, preprocess=True, postprocess=False)
and this is the space: