versae commited on
Commit
43b19d1
·
1 Parent(s): 0a605af

Fixed indexing error

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -12,7 +12,7 @@ def translate(text):
12
  "inputs": text,
13
  }
14
  response = requests.post(API_URL, headers=headers, json=payload)
15
- json_response = response.json()
16
  if "error" in json_response:
17
  return f"Model still loading: {json_response}"
18
  elif "translation_text" in json_response:
 
12
  "inputs": text,
13
  }
14
  response = requests.post(API_URL, headers=headers, json=payload)
15
+ json_response = response.json()[0]
16
  if "error" in json_response:
17
  return f"Model still loading: {json_response}"
18
  elif "translation_text" in json_response: