Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -31,8 +31,8 @@ def translate(input, output, text):
|
|
| 31 |
}
|
| 32 |
response = requests.request("POST", API_URL, json=json_)
|
| 33 |
output = response.json()[0]['generated_text']
|
| 34 |
-
|
| 35 |
-
return output.
|
| 36 |
|
| 37 |
demo = gr.Blocks()
|
| 38 |
|
|
|
|
| 31 |
}
|
| 32 |
response = requests.request("POST", API_URL, json=json_)
|
| 33 |
output = response.json()[0]['generated_text']
|
| 34 |
+
output = output.replace(instruction, '', 1)
|
| 35 |
+
return output[output.find(f'Translation in {output}')+len(f'Translation in {output}'):].split('<end>')[0]
|
| 36 |
|
| 37 |
demo = gr.Blocks()
|
| 38 |
|