Akash VP commited on
Commit
41de639
·
1 Parent(s): 41cef5f

add application file and requirment

Browse files
Files changed (2) hide show
  1. app.py +14 -0
  2. requirements.txt +2 -0
app.py ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from transformers import pipeline
3
+
4
+ classifier = pipeline("sentiment-analysis")
5
+
6
+
7
+ def predict(text):
8
+ result = classifier(text)[0]
9
+ return f"{result['label']} ({result['score']:.2f})"
10
+
11
+
12
+ gr.Interface(
13
+ fn=predict, inputs="text", outputs="text", title="Sentiment analyzer"
14
+ ).launch()
requirements.txt ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ torch==2.8.0,
2
+ transformers==4.56.2,