lampongyuen commited on
Commit
425420a
·
1 Parent(s): c4f3c72

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -7,6 +7,7 @@ model = AutoModelForSeq2SeqLM.from_pretrained("facebook/nllb-200-distilled-600M"
7
  tokenizer = AutoTokenizer.from_pretrained("facebook/nllb-200-distilled-600M")
8
  device = 0 if torch.cuda.is_available() else -1
9
  LANGS = ["ace_Arab", "eng_Latn", "fra_Latn", "spa_Latn", "yue_Hant","zho_Hans","zho_Hant"]
 
10
 
11
  # Yue Chinese - yue_Hant, Chinese (Simplified)-Zho_Hans, Chinese(Traditional)-zho_Hant
12
  # https://github.com/facebookresearch/flores/tree/main/flores200#languages-in-flores-200
@@ -23,7 +24,7 @@ demo = gr.Interface(
23
  fn=translate,
24
  inputs=[
25
  gr.components.Textbox(label="Text"),
26
- gr.components.Dropdown(label="Source Language", choices=LANGS),
27
  gr.components.Dropdown(label="Target Language", choices=LANGS),
28
  ],
29
  outputs=["text"],
 
7
  tokenizer = AutoTokenizer.from_pretrained("facebook/nllb-200-distilled-600M")
8
  device = 0 if torch.cuda.is_available() else -1
9
  LANGS = ["ace_Arab", "eng_Latn", "fra_Latn", "spa_Latn", "yue_Hant","zho_Hans","zho_Hant"]
10
+ LANGS_source = ["eng_Latn"]
11
 
12
  # Yue Chinese - yue_Hant, Chinese (Simplified)-Zho_Hans, Chinese(Traditional)-zho_Hant
13
  # https://github.com/facebookresearch/flores/tree/main/flores200#languages-in-flores-200
 
24
  fn=translate,
25
  inputs=[
26
  gr.components.Textbox(label="Text"),
27
+ gr.components.Dropdown(label="Source Language", choices=LANGS_source),
28
  gr.components.Dropdown(label="Target Language", choices=LANGS),
29
  ],
30
  outputs=["text"],