emya commited on
Commit
d0b3af7
·
1 Parent(s): e3da9e1

Add application file

Browse files
Files changed (1) hide show
  1. app.py +17 -0
app.py ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+
3
+ from transformers import pipeline
4
+
5
+ pipe = pipeline("translation", model="emya/vicuna-7b-v1.5-steve-jobs-v1")
6
+
7
+ def predict(text):
8
+ prompt = f"{text} (Answer in a few sentences)"
9
+ return pipe(prompt)[0]["translation_text"]
10
+
11
+ demo = gr.Interface(
12
+ fn=predict,
13
+ inputs='text',
14
+ outputs='text',
15
+ )
16
+
17
+ demo.launch()