traductor / app.py
alexvc99's picture
Update app.py
26bc654 verified
raw
history blame contribute delete
294 Bytes
import gradio as gr
from transformers import pipeline
def traduce(frase):
pipe = pipeline("translation", model="Helsinki-NLP/opus-mt-en-es")
frase_es = pipe(frase)
return frase_es[0]['translation_text']
demo = gr.Interface(fn=traduce, inputs="text", outputs="text")
demo.launch()