Dao3 commited on
Commit
6457060
·
1 Parent(s): 62caeb1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -7,7 +7,7 @@ openai.api_key = os.environ['OPENAI_KEY']
7
  supportLanguages = [
8
  ["自动识别", "自动识别"],
9
  ["粤语", "粤语"],
10
- ["古文", "wyw"],
11
  ["af","Afrikaans"],
12
  ["ak","Akan"],
13
  ["sq","Albanian"],
@@ -28,8 +28,8 @@ supportLanguages = [
28
  ["ca","Catalan"],
29
  ["chr","Cherokee"],
30
  ["ny","Chichewa"],
31
- ["zh-CN","Chinese (Simplified)"],
32
- ["zh-TW","Chinese (Traditional)"],
33
  ["co","Corsican"],
34
  ["hr","Croatian"],
35
  ["cs","Czech"],
@@ -233,15 +233,15 @@ with gr.Blocks(css=css) as demo:
233
  state = gr.State([])
234
 
235
  with gr.Column(elem_id="col-container"):
236
- gr.Markdown("""## 翻译利器
237
  使用OpenAI官方 API (gpt-3.5-turbo model).""", elem_id="header")
238
 
239
  with gr.Row():
240
  with gr.Column():
241
- translateFrom = gr.Dropdown(label="原文", elem_id="translate-from", multiselect=False, value="auto", choices=[l[1] for l in supportLanguages]).style(container=False)
242
  input_message = gr.Textbox(max_lines=100, show_label=False, lines=10, placeholder="Enter text and press enter", visible=True).style(container=False)
243
  with gr.Column():
244
- translateTo = gr.Dropdown(label="译文", elem_id="translate-to", multiselect=False, value="Chinese (Simplified)", choices=[l[1] for l in supportLanguages[1:]]).style(container=False)
245
  output = gr.Textbox(max_lines=100, show_label=False, lines=10, label="Output", visible=True).style(container=False)
246
 
247
  btn_submit = gr.Button("急急如律令")
 
7
  supportLanguages = [
8
  ["自动识别", "自动识别"],
9
  ["粤语", "粤语"],
10
+ ["古文", "文言文"],
11
  ["af","Afrikaans"],
12
  ["ak","Akan"],
13
  ["sq","Albanian"],
 
28
  ["ca","Catalan"],
29
  ["chr","Cherokee"],
30
  ["ny","Chichewa"],
31
+ ["zh-CN","中文(简体)"],
32
+ ["zh-TW","中文 (繁体)"],
33
  ["co","Corsican"],
34
  ["hr","Croatian"],
35
  ["cs","Czech"],
 
233
  state = gr.State([])
234
 
235
  with gr.Column(elem_id="col-container"):
236
+ gr.Markdown("""## 多语言翻译
237
  使用OpenAI官方 API (gpt-3.5-turbo model).""", elem_id="header")
238
 
239
  with gr.Row():
240
  with gr.Column():
241
+ translateFrom = gr.Dropdown(label="原文", elem_id="translate-from", multiselect=False, value="自动识别", choices=[l[1] for l in supportLanguages]).style(container=False)
242
  input_message = gr.Textbox(max_lines=100, show_label=False, lines=10, placeholder="Enter text and press enter", visible=True).style(container=False)
243
  with gr.Column():
244
+ translateTo = gr.Dropdown(label="译文", elem_id="translate-to", multiselect=False, value="中文 (简体)", choices=[l[1] for l in supportLanguages[1:]]).style(container=False)
245
  output = gr.Textbox(max_lines=100, show_label=False, lines=10, label="Output", visible=True).style(container=False)
246
 
247
  btn_submit = gr.Button("急急如律令")