Spaces:
Build error
Build error
File size: 297 Bytes
52ae1eb 5570d26 52ae1eb 5b8311b |
1 2 3 4 5 6 7 8 9 10 11 |
from transformers import pipeline
import gradio as grad
mdl_name = "Helsinki-NLP/opus-mt-en-es"
opus_translator = pipeline("translation", model=mdl_name)
def translate(text):
response = opus_translator(text)
return response
grad.Interface(translate, inputs=["text",], outputs="text").
launch()
|