Duha commited on
Commit
49ba513
1 Parent(s): 0754f94

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -0
app.py ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ from transformers import pipeline
2
+ import gradio as grad
3
+ mdl_name = "Shularp/krirk-finetuned-Helsinki-NLP_opus-mt-en-ar"
4
+ opus_translator = pipeline("translation", model=mdl_name)
5
+ def translate(text):
6
+ response = opus_translator(text)
7
+ return response
8
+ grad.Interface(translate, inputs=["text",], outputs="text").launch()