try_space / app.py
luofeim's picture
with gradio + requirements.txt
6dde620
raw
history blame contribute delete
392 Bytes
import gradio as gr
#def greet(name):
# return "Hello " + name + "!!"
#iface = gr.Interface(fn=greet, inputs="text", outputs="text")
#iface.launch()
from transformers import pipeline
pipe = pipeline("translation", model="Helsinki-NLP/opus-mt-en-es")
demo = gr.Interface.from_pipeline(pipe)
demo.launch()
#demo = gr.load("Helsinki-NLP/opus-mt-en-es", src="models")
#demo.launch()