dl-translate / app.py
kintong3000's picture
Update app.py
e161efd
raw
history blame contribute delete
408 Bytes
import gradio as gr
import dl_translate as dlt
mt = dlt.TranslationModel()
def translateapi(inputtext,from_lang,to_lang):
text_in = str(inputtext)
form = str(from_lang)
to = str(to_lang)
translation = mt.translate(text_in, source=form, target=to)
return translation
demo = gr.Interface(
fn=translateapi,
inputs=["text", "text", "text"],
outputs="text",
)
demo.launch()