Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,12 +1,10 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
-
import torch
|
| 3 |
from transformers import pipeline
|
| 4 |
|
| 5 |
# Load the model
|
| 6 |
model_name = "knowledgator/comprehend_it-base"
|
| 7 |
classifier = pipeline("zero-shot-classification", model=model_name, device="cpu")
|
| 8 |
|
| 9 |
-
|
| 10 |
# Function to classify feedback
|
| 11 |
def classify_feedback(feedback_text):
|
| 12 |
# Classify feedback using the loaded model
|
|
@@ -20,7 +18,7 @@ def classify_feedback(feedback_text):
|
|
| 20 |
return {top_labels[i]: scores[i] for i in range(len(top_labels))}
|
| 21 |
|
| 22 |
# Create Gradio interface
|
| 23 |
-
feedback_textbox = gr.inputs.
|
| 24 |
feedback_output = gr.outputs.Textbox(label="Top 2 Labels with Scores:")
|
| 25 |
|
| 26 |
gr.Interface(
|
|
|
|
| 1 |
import gradio as gr
|
|
|
|
| 2 |
from transformers import pipeline
|
| 3 |
|
| 4 |
# Load the model
|
| 5 |
model_name = "knowledgator/comprehend_it-base"
|
| 6 |
classifier = pipeline("zero-shot-classification", model=model_name, device="cpu")
|
| 7 |
|
|
|
|
| 8 |
# Function to classify feedback
|
| 9 |
def classify_feedback(feedback_text):
|
| 10 |
# Classify feedback using the loaded model
|
|
|
|
| 18 |
return {top_labels[i]: scores[i] for i in range(len(top_labels))}
|
| 19 |
|
| 20 |
# Create Gradio interface
|
| 21 |
+
feedback_textbox = gr.inputs.Text(label="Enter your feedback:")
|
| 22 |
feedback_output = gr.outputs.Textbox(label="Top 2 Labels with Scores:")
|
| 23 |
|
| 24 |
gr.Interface(
|