Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -37,7 +37,7 @@ def get_alternate_text(text, language):
|
|
37 |
response = requests.post(ENDPOINT, data=json.dumps(payload), headers=headers)
|
38 |
retries += 1
|
39 |
continue
|
40 |
-
if
|
41 |
return "Error. Please refresh and try", None
|
42 |
texts = list(filter(lambda x: len(x.strip()) > 0, resp_text.split("\n")))
|
43 |
counts = list(map(lambda x: len(x.split()), texts))
|
|
|
37 |
response = requests.post(ENDPOINT, data=json.dumps(payload), headers=headers)
|
38 |
retries += 1
|
39 |
continue
|
40 |
+
if resp_text is None:
|
41 |
return "Error. Please refresh and try", None
|
42 |
texts = list(filter(lambda x: len(x.strip()) > 0, resp_text.split("\n")))
|
43 |
counts = list(map(lambda x: len(x.split()), texts))
|