Patt's picture
Update app.py
bfda255
raw
history blame
654 Bytes
# -*- coding: utf-8 -*-
"""Test deploying model on huggingface space.ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1VRB3YKw0bl47Lp_CuxXwyCsU9JGXq3sY
"""
import gradio as gr
from transformers import pipeline
translation = pipeline("translation", "Shularp/krirk-finetuned-Helsinki-NLP_opus-mt-ar-en")
def translate(text):
result = translation(text)
return result
description = "Arabic-English translation machine"
title = "Translate"
interface = gr.Interface(fn=translate, inputs="text", outputs=["text"],
description=description)
interface.launch()