Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -2,20 +2,20 @@ import gradio as gr
|
|
| 2 |
from transformers import pipeline
|
| 3 |
|
| 4 |
|
| 5 |
-
def trnslt(
|
| 6 |
txt_inp = gr.Interface.load("huggingface/Helsinki-NLP/opus-mt-tl-en")
|
| 7 |
if Language=="Cebuano":
|
| 8 |
ceb1 = gr.Interface.load("huggingface/Helsinki-NLP/opus-mt-en-ceb")
|
| 9 |
out_ceb = gr.Series(txt_inp,ceb1)
|
| 10 |
-
return out_ceb(
|
| 11 |
elif Language=="Ilocano":
|
| 12 |
ilo1 = gr.Interface.load("huggingface/Helsinki-NLP/opus-mt-en-ilo")
|
| 13 |
out_ilo = gr.Series(txt_inp,ilo1)
|
| 14 |
-
return out_ilo(
|
| 15 |
elif Language=="Hiligaynon":
|
| 16 |
hil1 = gr.Interface.load("huggingface/Helsinki-NLP/opus-mt-en-hil")
|
| 17 |
out_hil = gr.Series(txt_inp,hil1)
|
| 18 |
-
return out_hil(
|
| 19 |
|
| 20 |
iface = gr.Interface(
|
| 21 |
fn=trnslt,
|
|
@@ -26,7 +26,7 @@ iface = gr.Interface(
|
|
| 26 |
live=True,
|
| 27 |
theme="seafoam",
|
| 28 |
title="Basic Filipino Dialect Translator",
|
| 29 |
-
|
| 30 |
css=".footer{display:none !important}",
|
| 31 |
)
|
| 32 |
|
|
|
|
| 2 |
from transformers import pipeline
|
| 3 |
|
| 4 |
|
| 5 |
+
def trnslt(TagalogText,Language):
|
| 6 |
txt_inp = gr.Interface.load("huggingface/Helsinki-NLP/opus-mt-tl-en")
|
| 7 |
if Language=="Cebuano":
|
| 8 |
ceb1 = gr.Interface.load("huggingface/Helsinki-NLP/opus-mt-en-ceb")
|
| 9 |
out_ceb = gr.Series(txt_inp,ceb1)
|
| 10 |
+
return out_ceb(TagalogText)
|
| 11 |
elif Language=="Ilocano":
|
| 12 |
ilo1 = gr.Interface.load("huggingface/Helsinki-NLP/opus-mt-en-ilo")
|
| 13 |
out_ilo = gr.Series(txt_inp,ilo1)
|
| 14 |
+
return out_ilo(TagalogText)
|
| 15 |
elif Language=="Hiligaynon":
|
| 16 |
hil1 = gr.Interface.load("huggingface/Helsinki-NLP/opus-mt-en-hil")
|
| 17 |
out_hil = gr.Series(txt_inp,hil1)
|
| 18 |
+
return out_hil(TagalogText)
|
| 19 |
|
| 20 |
iface = gr.Interface(
|
| 21 |
fn=trnslt,
|
|
|
|
| 26 |
live=True,
|
| 27 |
theme="seafoam",
|
| 28 |
title="Basic Filipino Dialect Translator",
|
| 29 |
+
description="This application uses Helsinki-NLP models models to translate native Tagalog texts to 3 dialects of the Filipino language",
|
| 30 |
css=".footer{display:none !important}",
|
| 31 |
)
|
| 32 |
|