Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -17,11 +17,15 @@ label_map = {
|
|
17 |
"LABEL_1": "LLM (1)",
|
18 |
"1": "LLM (1)"
|
19 |
}
|
20 |
-
|
|
|
21 |
# Function to load the selected model and classify text
|
22 |
def classify_text(model_name, text):
|
23 |
try:
|
24 |
-
|
|
|
|
|
|
|
25 |
predictions = classifier(text)
|
26 |
|
27 |
# Process predictions to use friendly labels
|
|
|
17 |
"LABEL_1": "LLM (1)",
|
18 |
"1": "LLM (1)"
|
19 |
}
|
20 |
+
large_v3 = classifier = pipeline("text-classification", model="underscore2/modernbert_large_slop_classifier_v3", top_k=None)
|
21 |
+
|
22 |
# Function to load the selected model and classify text
|
23 |
def classify_text(model_name, text):
|
24 |
try:
|
25 |
+
if models[model_name] != "underscore2/modernbert_large_slop_classifier_v3":
|
26 |
+
classifier = pipeline("text-classification", model=models[model_name], top_k=None)
|
27 |
+
else:
|
28 |
+
classifier = large_v3
|
29 |
predictions = classifier(text)
|
30 |
|
31 |
# Process predictions to use friendly labels
|