deepsync commited on
Commit
f13775c
·
1 Parent(s): 595c50d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
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 retries >= 5:
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))