Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -8,6 +8,7 @@ model = AutoModelForSequenceClassification.from_pretrained("willco-afk/my-model-
|
|
8 |
|
9 |
# Function to classify input text
|
10 |
def classify_text(text):
|
|
|
11 |
inputs = tokenizer(text, return_tensors="pt", truncation=True, padding=True)
|
12 |
with torch.no_grad():
|
13 |
logits = model(**inputs).logits
|
@@ -15,5 +16,5 @@ def classify_text(text):
|
|
15 |
return f"Predicted class: {predicted_class}"
|
16 |
|
17 |
# Gradio Interface
|
18 |
-
demo = gr.Interface(fn=classify_text, inputs="text", outputs="text")
|
19 |
demo.launch()
|
|
|
8 |
|
9 |
# Function to classify input text
|
10 |
def classify_text(text):
|
11 |
+
print("Classifying:", text) # Check if this gets printed
|
12 |
inputs = tokenizer(text, return_tensors="pt", truncation=True, padding=True)
|
13 |
with torch.no_grad():
|
14 |
logits = model(**inputs).logits
|
|
|
16 |
return f"Predicted class: {predicted_class}"
|
17 |
|
18 |
# Gradio Interface
|
19 |
+
demo = gr.Interface(fn=classify_text, inputs="text", outputs="text", layout="vertical")
|
20 |
demo.launch()
|