File size: 472 Bytes
76eec44
 
 
bfda255
76eec44
 
31e634c
fe98b98
76eec44
 
 
fbf21da
 
 
 
 
76eec44
1d5cc21
76eec44
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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()