lalital commited on
Commit
81d462a
1 Parent(s): 98bbecc

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +20 -0
app.py ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+
3
+ from transformers import pipeline
4
+
5
+ pipe = pipeline("text-classification",
6
+ model="airesearch/wangchanbart-large",
7
+ tokenizer="airesearch/wangchanbart-large"
8
+ revision="finetuned@wisesight_sentiment"
9
+ )
10
+
11
+ def predict(text):
12
+ return pipe(text)
13
+
14
+ demo = gr.Interface(
15
+ fn=predict,
16
+ inputs='text',
17
+ outputs='text',
18
+ )
19
+
20
+ demo.launch()