zionia commited on
Commit
ef9b88b
1 Parent(s): 4f70f9f

fix src and tgt lang error

Browse files
Files changed (1) hide show
  1. app.py +7 -2
app.py CHANGED
@@ -1,7 +1,12 @@
1
  import gradio as gr
2
- from transformers import pipeline
3
 
4
- translater_nr_en = pipeline("translation", model="dsfsi/nr-en-m2m100-gov", src_lang="nr", tgt_lang="en")
 
 
 
 
 
5
 
6
  def translate(inp):
7
  # Translate from isiNdebele to English
 
1
  import gradio as gr
2
+ from transformers import pipeline, M2M100Tokenizer
3
 
4
+ model_name = "dsfsi/nr-en-m2m100-gov"
5
+ tokenizer = M2M100Tokenizer.from_pretrained(model_name)
6
+
7
+ print(tokenizer.lang_code_to_token)
8
+
9
+ translater_nr_en = pipeline("translation", model=model_name, src_lang="nr", tgt_lang="en")
10
 
11
  def translate(inp):
12
  # Translate from isiNdebele to English