Spaces:
Runtime error
Runtime error
gaspar-avit
commited on
Commit
·
657d4a2
1
Parent(s):
a7ea406
Upload app.py
Browse files
app.py
CHANGED
@@ -190,13 +190,15 @@ def query_generate(text, genres):
|
|
190 |
|
191 |
response = requests.post(API_URL, headers=headers, json=payload)
|
192 |
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
|
|
|
|
200 |
|
201 |
return response.content
|
202 |
|
|
|
190 |
|
191 |
response = requests.post(API_URL, headers=headers, json=payload)
|
192 |
|
193 |
+
try:
|
194 |
+
response_str = response.content.decode("utf-8")
|
195 |
+
if 'error' in response_str:
|
196 |
+
payload = {"inputs": f"{text}",
|
197 |
+
"options": {"wait_for_model": True},
|
198 |
+
}
|
199 |
+
response = requests.post(API_URL, headers=headers, json=payload)
|
200 |
+
except:
|
201 |
+
pass
|
202 |
|
203 |
return response.content
|
204 |
|