Spaces:
Sleeping
Sleeping
muzamilhxmi
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -4,10 +4,10 @@ from transformers import pipeline, AutoConfig
|
|
4 |
MODEL_NAME = "blaikhole/distilbert-review-bug-classifier"
|
5 |
|
6 |
label_mapping = {
|
7 |
-
"LABEL_0": "Graphics 🎨",
|
8 |
-
"LABEL_1": "Network 🌐",
|
9 |
"LABEL_2": "No Bug ✅",
|
10 |
-
"LABEL_3": "Performance 🚀"
|
11 |
}
|
12 |
|
13 |
# Load model config to get label mapping
|
@@ -31,7 +31,7 @@ if st.button("Classify"):
|
|
31 |
|
32 |
predictions = {label_mapping.get(res['label'], res['label']): int(res['score'] * 100) for res in result}
|
33 |
|
34 |
-
ordered_labels = ["Graphics 🎨", "Network 🌐", "No Bug ✅", "Performance 🚀"]
|
35 |
ordered_predictions = {k: predictions[k] for k in ordered_labels if k in predictions}
|
36 |
|
37 |
# Get top prediction
|
|
|
4 |
MODEL_NAME = "blaikhole/distilbert-review-bug-classifier"
|
5 |
|
6 |
label_mapping = {
|
7 |
+
"LABEL_0": "Graphics issue 🎨",
|
8 |
+
"LABEL_1": "Network issue 🌐",
|
9 |
"LABEL_2": "No Bug ✅",
|
10 |
+
"LABEL_3": "Performance issue 🚀"
|
11 |
}
|
12 |
|
13 |
# Load model config to get label mapping
|
|
|
31 |
|
32 |
predictions = {label_mapping.get(res['label'], res['label']): int(res['score'] * 100) for res in result}
|
33 |
|
34 |
+
ordered_labels = ["Graphics issue 🎨", "Network issue 🌐", "No Bug ✅", "Performance issue 🚀"]
|
35 |
ordered_predictions = {k: predictions[k] for k in ordered_labels if k in predictions}
|
36 |
|
37 |
# Get top prediction
|