File size: 654 Bytes
76eec44
 
 
 
 
 
 
 
 
 
 
 
 
bfda255
76eec44
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# -*- 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()