Spaces:
Runtime error
Runtime error
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() |