admin commited on
Commit
48cb7fe
·
1 Parent(s): c9e71be
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -6,7 +6,7 @@ import gradio as gr
6
 
7
  def translate(source, direction):
8
  if not source or not direction:
9
- return "请输入有效文本并选择模式!"
10
 
11
  # WARNING, this token is a test token for new developers, and it should be replaced by your token
12
  payload = {
@@ -38,16 +38,16 @@ if __name__ == "__main__":
38
  fn=translate,
39
  inputs=[
40
  gr.TextArea(
41
- label="输入文本区域",
42
- placeholder="在这里输入文本...",
43
  show_copy_button=True,
44
  ),
45
- gr.Dropdown(choices=["auto2en", "auto2zh", "auto2ja"], label="模式"),
46
  ],
47
- outputs=gr.TextArea(label="翻译结果", show_copy_button=True),
48
  flagging_mode="never",
49
  examples=[
50
- ["彩云小译は最高の翻訳サービスです", "auto2zh"],
51
  ["Lingocloud is the best translation service.", "auto2zh"],
52
  ],
53
  ).launch()
 
6
 
7
  def translate(source, direction):
8
  if not source or not direction:
9
+ return "Please enter valid text and select the mode!"
10
 
11
  # WARNING, this token is a test token for new developers, and it should be replaced by your token
12
  payload = {
 
38
  fn=translate,
39
  inputs=[
40
  gr.TextArea(
41
+ label="Input text area",
42
+ placeholder="Type the text here...",
43
  show_copy_button=True,
44
  ),
45
+ gr.Dropdown(choices=["auto2en", "auto2zh", "auto2ja"], label="Mode"),
46
  ],
47
+ outputs=gr.TextArea(label="Translation results", show_copy_button=True),
48
  flagging_mode="never",
49
  examples=[
50
+ ["彩云小译は最高の翻訳サービスです", "auto2en"],
51
  ["Lingocloud is the best translation service.", "auto2zh"],
52
  ],
53
  ).launch()