Carsoleong commited on
Commit
73e3c19
·
1 Parent(s): 7d1ef5e

Upload Gradio app

Browse files
Files changed (1) hide show
  1. app.py +14 -0
app.py ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from transformers import pipeline
3
+
4
+ # Load model
5
+ classifier = pipeline("sentiment-analysis", model="Carsoleong/babi")
6
+
7
+ # Define inference function
8
+ def predict(text):
9
+ return classifier(text)
10
+
11
+ # Define Gradio interface
12
+ interface = gr.Interface(fn=predict, inputs="text", outputs="label", title="Sentiment Classifier")
13
+
14
+ interface.launch()