LiveEvil commited on
Commit
6ea8afb
·
1 Parent(s): d754853

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -1
app.py CHANGED
@@ -1,3 +1,17 @@
1
  import gradio as gr
2
 
3
- gr.Interface.load("datasciencemmw/pickonai-best").launch()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  import gradio as gr
2
 
3
+ from transformers import pipeline
4
+
5
+ pipe = pipeline("translation", model="Helsinki-NLP/opus-mt-en-es")
6
+
7
+ def predict(text):
8
+ return pipe(text)[0]["translation_text"]
9
+
10
+ iface = gr.Interface(
11
+ fn=predict,
12
+ inputs='text',
13
+ outputs='text',
14
+ examples=[["Hello! My name is Omar"]]
15
+ )
16
+
17
+ iface.launch()