Spaces:
Sleeping
Sleeping
Update tasks/text.py
Browse files- tasks/text.py +4 -2
tasks/text.py
CHANGED
@@ -75,6 +75,7 @@ async def evaluate_text(request: TextEvaluationRequest):
|
|
75 |
# Make random predictions (placeholder for actual model inference)
|
76 |
true_labels = test_dataset["label"]
|
77 |
|
|
|
78 |
from torch import nn, optim
|
79 |
|
80 |
class SimpleNN2(nn.Module):
|
@@ -95,12 +96,13 @@ async def evaluate_text(request: TextEvaluationRequest):
|
|
95 |
x = self.dropout(x) # Apply dropout
|
96 |
x = self.fc3(x) # Output raw logits
|
97 |
return x
|
|
|
98 |
|
99 |
current_file_path = os.path.abspath(__file__)
|
100 |
current_dir = os.path.dirname(current_file_path)
|
101 |
|
102 |
-
model_nn = torch.load(os.path.join(current_dir,"model_nn.pth"), map_location=device)
|
103 |
-
|
104 |
|
105 |
|
106 |
# Set the model to evaluation mode
|
|
|
75 |
# Make random predictions (placeholder for actual model inference)
|
76 |
true_labels = test_dataset["label"]
|
77 |
|
78 |
+
"""
|
79 |
from torch import nn, optim
|
80 |
|
81 |
class SimpleNN2(nn.Module):
|
|
|
96 |
x = self.dropout(x) # Apply dropout
|
97 |
x = self.fc3(x) # Output raw logits
|
98 |
return x
|
99 |
+
"""
|
100 |
|
101 |
current_file_path = os.path.abspath(__file__)
|
102 |
current_dir = os.path.dirname(current_file_path)
|
103 |
|
104 |
+
# model_nn = torch.load(os.path.join(current_dir,"model_nn.pth"), map_location=device)
|
105 |
+
model_nn = torch.load(os.path.join(current_dir,"model_nn_scripted.pth"), map_location=device)
|
106 |
|
107 |
|
108 |
# Set the model to evaluation mode
|