Spaces:
Runtime error
Runtime error
Create src/app.py
Browse files- src/app.py +9 -0
src/app.py
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
from transformers import pipeline
|
| 3 |
+
|
| 4 |
+
clf = pipeline("sentiment-analysis", model="./outputs")
|
| 5 |
+
|
| 6 |
+
def classify(text):
|
| 7 |
+
return clf(text)[0]['label']
|
| 8 |
+
|
| 9 |
+
gr.Interface(fn=classify, inputs="text", outputs="text", title="Sentiment Classifier").launch()
|