Spaces:
Runtime error
Runtime error
Commit
·
9ddbf53
1
Parent(s):
ec2edc5
add
Browse files
app.py
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
from transformers import pipeline
|
| 3 |
+
|
| 4 |
+
classifier = pipeline("text-classification", model="karimmohamed19/final")
|
| 5 |
+
|
| 6 |
+
def classify(text):
|
| 7 |
+
result = classifier(text)
|
| 8 |
+
return result[0]['label']
|
| 9 |
+
|
| 10 |
+
iface = gr.Interface(fn=classify, inputs="text", outputs="text")
|
| 11 |
+
iface.launch()
|