Javitron4257's picture
This is the main file of the space
9e4d87f verified
raw
history blame contribute delete
312 Bytes
import gradio as gr
from transformers import pipeline
def traductor(prompt):
pipe = pipeline("translation", model="Helsinki-NLP/opus-mt-en-es")
frase_traducida=pipe(prompt)
return frase_traducida[0]['translation_text']
demo = gr.Interface(fn=traductor, inputs="text", outputs="text")
demo.launch()