willco-afk commited on
Commit
bba7d55
·
verified ·
1 Parent(s): eb6a2b0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
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()