Fixed indexing error
Browse files
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:
|