Duha's picture
Create app.py
49ba513
raw
history blame
319 Bytes
from transformers import pipeline
import gradio as grad
mdl_name = "Shularp/krirk-finetuned-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()