Patt's picture
Update app.py
fe98b98
raw
history blame contribute delete
472 Bytes
import gradio as gr
from transformers import pipeline
translation = pipeline("translation", "Shularp/krirk-finetuned-Helsinki-NLP_opus-mt-ar-en")
def translate(text):
results = translation(text)
return results[0]["translation_text"]
interface = gr.Interface(fn=translate,
inputs="text",
outputs=["text"],
title = "Translator",
description="Arabic-English translation machine")
interface.launch()