Prueba-Gradio / app.py
IsmaMore's picture
Update app.py
03d561c verified
raw
history blame contribute delete
304 Bytes
import gradio as gr
from transformers import pipeline
def traduce(Frase):
pipe = pipeline("translation", model="Helsinki-NLP/opus-mt-en-ca")
frase_ca = pipe(Frase)
return frase_ca[0]['translation_text']
demo = gr.Interface(fn=traduce, inputs="text", outputs="text")
demo.launch(share=True)