Juna190825 commited on
Commit
13e6865
·
verified ·
1 Parent(s): 215420c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -0
app.py CHANGED
@@ -37,12 +37,19 @@ def translate_zomi(text: str):
37
 
38
  # Remove prefix
39
  prefix = "Translate Zomi to English, if it is English translate it to Zomi: "
 
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
 
48
 
 
37
 
38
  # Remove prefix
39
  prefix = "Translate Zomi to English, if it is English translate it to Zomi: "
40
+ prefix2 = "Zomi pan English in tei in, English ahih leh Zomi in tei in: "
41
  if output.startswith(prefix):
42
  output = output[len(prefix):].strip()
43
  # Remove surrounding quotes
44
  if (output.startswith('"') and output.endswith('"')) or (output.startswith("'") and output.endswith("'")):
45
  output = output[1:-1].strip()
46
 
47
+ elif output.startswith(prefix2):
48
+ output = output[len(prefix2):].strip()
49
+ # Remove surrounding quotes
50
+ if (output.startswith('"') and output.endswith('"')) or (output.startswith("'") and output.endswith("'")):
51
+ output = output[1:-1].strip()
52
+
53
  return output
54
 
55