Spaces:
Sleeping
Sleeping
fix src and tgt lang error
Browse files
app.py
CHANGED
@@ -1,7 +1,12 @@
|
|
1 |
import gradio as gr
|
2 |
-
from transformers import pipeline
|
3 |
|
4 |
-
|
|
|
|
|
|
|
|
|
|
|
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
|