Spaces:
Runtime error
Runtime error
Add sleep time to help server recovery of the fastness
Browse files42 unmodified lines43444546474849495051525354555642 unmodified lines json_response = response.json() #If the output component is JSON return the entire output response if(outputs[0].get_config()["name"] == "json"): time.sleep(1) return json_response["output"] predict_outputs = parse_outputs(json_response["output"]) processed_outputs = process_outputs(predict_outputs) time.sleep(1) return tuple(processed_outputs) if len(processed_outputs) > 1 else processed_outputs[0] else: time.sleep(1) if(response.status_code == 409): raise gr.Error(f"Sorry, the Cog image is still processing. Try again in a bit.") raise gr.Error(f"The submission failed! Error: {response.status_code}")app.py+3-1