zionia commited on
Commit
965bd13
·
verified ·
1 Parent(s): 4f63972

update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -5,7 +5,9 @@ model_name = "dsfsi/nso-en-m2m100-gov"
5
  tokenizer = M2M100Tokenizer.from_pretrained(model_name)
6
  model = M2M100ForConditionalGeneration.from_pretrained(model_name)
7
 
8
- tokenizer.src_lang = "nso"
 
 
9
 
10
  model.config.forced_bos_token_id = tokenizer.get_lang_id("en")
11
 
@@ -32,10 +34,8 @@ iface = gr.Interface(
32
  title="Northern Sotho to English Translation",
33
  description=description,
34
  article=article,
35
- examples=examples,
36
  inputs=gr.components.Textbox(lines=5, placeholder="Enter Sotho text (maximum 5 lines)", label="Input"),
37
  outputs="text"
38
  )
39
 
40
  iface.launch(enable_queue=True)
41
-
 
5
  tokenizer = M2M100Tokenizer.from_pretrained(model_name)
6
  model = M2M100ForConditionalGeneration.from_pretrained(model_name)
7
 
8
+ print(tokenizer.lang_code_to_token)
9
+
10
+ tokenizer.src_lang = "nso"
11
 
12
  model.config.forced_bos_token_id = tokenizer.get_lang_id("en")
13
 
 
34
  title="Northern Sotho to English Translation",
35
  description=description,
36
  article=article,
 
37
  inputs=gr.components.Textbox(lines=5, placeholder="Enter Sotho text (maximum 5 lines)", label="Input"),
38
  outputs="text"
39
  )
40
 
41
  iface.launch(enable_queue=True)