ayymen commited on
Commit
2191500
1 Parent(s): cee7e4a

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -0
app.py ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from transformers import pipeline
3
+
4
+
5
+ pipe = pipeline("translation", model="Helsinki-NLP/opus-mt-en-ber")
6
+
7
+ def predict(text):
8
+ return pipe(text)[0]["translation_text"]
9
+
10
+ demo = gr.Interface(
11
+ fn=predict,
12
+ inputs='text',
13
+ outputs='text',
14
+ )
15
+
16
+ demo.launch()