Spaces:
Sleeping
Sleeping
japanese-denim
commited on
Commit
•
d4fb67d
1
Parent(s):
56fb26e
Update app.py
Browse files
app.py
CHANGED
@@ -2,7 +2,7 @@ import gradio as gr
|
|
2 |
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM, pipeline
|
3 |
import torch
|
4 |
|
5 |
-
model_checkpoint = "japanese-denim/
|
6 |
model = AutoModelForSeq2SeqLM.from_pretrained(model_checkpoint)
|
7 |
tokenizer = AutoTokenizer.from_pretrained(model_checkpoint)
|
8 |
|
@@ -10,8 +10,8 @@ def translate(text):
|
|
10 |
translation_pipeline = pipeline("translation",
|
11 |
model=model,
|
12 |
tokenizer = tokenizer,
|
13 |
-
src_lang='
|
14 |
-
tgt_lang='
|
15 |
|
16 |
result = translation_pipeline(text)
|
17 |
return result[0]['translation_text']
|
|
|
2 |
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM, pipeline
|
3 |
import torch
|
4 |
|
5 |
+
model_checkpoint = "japanese-denim/m2m-finetuned-naga-to-eng"
|
6 |
model = AutoModelForSeq2SeqLM.from_pretrained(model_checkpoint)
|
7 |
tokenizer = AutoTokenizer.from_pretrained(model_checkpoint)
|
8 |
|
|
|
10 |
translation_pipeline = pipeline("translation",
|
11 |
model=model,
|
12 |
tokenizer = tokenizer,
|
13 |
+
src_lang='en',
|
14 |
+
tgt_lang='en')
|
15 |
|
16 |
result = translation_pipeline(text)
|
17 |
return result[0]['translation_text']
|