Duha's picture
Update app.py
b665f0d
raw
history blame contribute delete
295 Bytes
from transformers import pipeline
import gradio as grad
mdl_name = "Helsinki-NLP/opus-mt-en-ar"
opus_translator = pipeline("translation", model=mdl_name)
def translate(text):
response = opus_translator(text)
return response
grad.Interface(translate, inputs=["text",], outputs="text").launch()