Spaces:
Sleeping
Sleeping
fixes
Browse files
app.py
CHANGED
|
@@ -31,12 +31,13 @@ def respond(
|
|
| 31 |
cleaned_output = response.text.strip().rstrip('%')
|
| 32 |
output = json.loads(cleaned_output)
|
| 33 |
|
| 34 |
-
if output
|
| 35 |
-
return "Error: Concurrency limit exceeded. Try submit your request again in a few seconds."
|
| 36 |
-
elif 'error' in output:
|
| 37 |
-
return f"Error: {output['error']['message']}. Refresh the page and try again later, post the error on OLAT forum if your issue persists."
|
| 38 |
-
else:
|
| 39 |
return output
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 40 |
|
| 41 |
|
| 42 |
demo = gr.Interface(
|
|
|
|
| 31 |
cleaned_output = response.text.strip().rstrip('%')
|
| 32 |
output = json.loads(cleaned_output)
|
| 33 |
|
| 34 |
+
if isinstance(output, str):
|
|
|
|
|
|
|
|
|
|
|
|
|
| 35 |
return output
|
| 36 |
+
elif 'error' in output:
|
| 37 |
+
if output['error']['code'] == 'concurrency_limit_exceeded':
|
| 38 |
+
return "Error: Concurrency limit exceeded. Try submit your request again in a few seconds."
|
| 39 |
+
else:
|
| 40 |
+
return f"Error: {output['error']['message']}. Refresh the page and try again later, post the error on OLAT forum if your issue persists."
|
| 41 |
|
| 42 |
|
| 43 |
demo = gr.Interface(
|