Spaces:
Sleeping
Sleeping
added correct mapping
Browse files
app.py
CHANGED
@@ -11,8 +11,10 @@ tokenizer = DistilBertTokenizer.from_pretrained('./fine_tuned_distilbert')
|
|
11 |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
12 |
model.to(device)
|
13 |
|
14 |
-
|
15 |
-
|
|
|
|
|
16 |
|
17 |
def predict_with_loaded_model(text):
|
18 |
# Tokenize the input text
|
|
|
11 |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
12 |
model.to(device)
|
13 |
|
14 |
+
mapping = {"Remembering": 0, "Understanding": 1, "Applying": 2, "Analyzing": 3, "Evaluating": 4, "Creating": 5}
|
15 |
+
|
16 |
+
# Reverse the mapping to get the class name from the index
|
17 |
+
reverse_mapping = {v: k for k, v in mapping.items()}
|
18 |
|
19 |
def predict_with_loaded_model(text):
|
20 |
# Tokenize the input text
|