Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -38,10 +38,10 @@ def translate_zomi(text: str):
|
|
| 38 |
# Remove prefix
|
| 39 |
prefix = "Translate Zomi to English:"
|
| 40 |
if output.startswith(prefix):
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
|
| 46 |
return output
|
| 47 |
|
|
|
|
| 38 |
# Remove prefix
|
| 39 |
prefix = "Translate Zomi to English:"
|
| 40 |
if output.startswith(prefix):
|
| 41 |
+
output = output[len(prefix):].strip()
|
| 42 |
+
# Remove surrounding quotes
|
| 43 |
+
if (output.startswith('"') and output.endswith('"')) or (output.startswith("'") and output.endswith("'")):
|
| 44 |
+
output = output[1:-1].strip()
|
| 45 |
|
| 46 |
return output
|
| 47 |
|