Update app.py
Browse files
app.py
CHANGED
@@ -2,12 +2,13 @@ import gradio as gr
|
|
2 |
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM, pipeline
|
3 |
import torch
|
4 |
|
5 |
-
model = AutoModelForSeq2SeqLM.from_pretrained("
|
6 |
-
tokenizer = AutoTokenizer.from_pretrained("
|
7 |
|
8 |
|
9 |
-
src_lang = '
|
10 |
-
tgt_lang = "
|
|
|
11 |
|
12 |
def translate(text):
|
13 |
translation_pipeline = pipeline("translation",
|
@@ -23,7 +24,7 @@ def translate(text):
|
|
23 |
gr.Interface(
|
24 |
translate,
|
25 |
[
|
26 |
-
gr.components.Textbox(label="Input Sentence", placeholder = " Enter
|
27 |
],
|
28 |
["text"],
|
29 |
).launch()
|
|
|
2 |
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM, pipeline
|
3 |
import torch
|
4 |
|
5 |
+
model = AutoModelForSeq2SeqLM.from_pretrained("KarmaCST/nllb-200-distilled-600M-dz-to-en")
|
6 |
+
tokenizer = AutoTokenizer.from_pretrained("KarmaCST/nllb-200-distilled-600M-dz-to-en")
|
7 |
|
8 |
|
9 |
+
src_lang = 'dzo_Tibt'
|
10 |
+
tgt_lang = "eng_Latn"
|
11 |
+
|
12 |
|
13 |
def translate(text):
|
14 |
translation_pipeline = pipeline("translation",
|
|
|
24 |
gr.Interface(
|
25 |
translate,
|
26 |
[
|
27 |
+
gr.components.Textbox(label="Input Sentence", placeholder = " Enter Dzongkha sentence here ...")
|
28 |
],
|
29 |
["text"],
|
30 |
).launch()
|