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