cirimus commited on
Commit
4dfc57d
·
verified ·
1 Parent(s): 8ed0852

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -7,8 +7,8 @@ models = {
7
  "ModernBERT Large (Go-Emotions)": "cirimus/modernbert-large-go-emotions"
8
  }
9
 
10
- # Function to load the selected model
11
- def classify_text(text, model_name):
12
  classifier = pipeline("text-classification", model=models[model_name], top_k=None)
13
  predictions = classifier(text)
14
  return {pred["label"]: pred["score"] for pred in predictions[0]}
@@ -29,7 +29,7 @@ interface = gr.Interface(
29
  )
30
  ],
31
  outputs=gr.Label(num_top_classes=5),
32
- title="ModernBERT Emotion Classifier",
33
  description="Select a model and enter a sentence to see its associated emotions and confidence scores.",
34
  )
35
 
 
7
  "ModernBERT Large (Go-Emotions)": "cirimus/modernbert-large-go-emotions"
8
  }
9
 
10
+ # Function to load the selected model and classify text
11
+ def classify_text(model_name, text):
12
  classifier = pipeline("text-classification", model=models[model_name], top_k=None)
13
  predictions = classifier(text)
14
  return {pred["label"]: pred["score"] for pred in predictions[0]}
 
29
  )
30
  ],
31
  outputs=gr.Label(num_top_classes=5),
32
+ title="Emotion Classifier",
33
  description="Select a model and enter a sentence to see its associated emotions and confidence scores.",
34
  )
35