Spaces:
Sleeping
Sleeping
Update tasks/text.py
Browse files- tasks/text.py +5 -4
tasks/text.py
CHANGED
@@ -29,8 +29,6 @@ async def evaluate_text(request: TextEvaluationRequest):
|
|
29 |
- Makes random predictions from the label space (0-7)
|
30 |
- Used as a baseline for comparison
|
31 |
"""
|
32 |
-
|
33 |
-
print(os.getcwd())
|
34 |
|
35 |
# Get space info
|
36 |
username, space_url = get_space_info()
|
@@ -98,8 +96,11 @@ async def evaluate_text(request: TextEvaluationRequest):
|
|
98 |
x = self.fc3(x) # Output raw logits
|
99 |
return x
|
100 |
|
101 |
-
|
102 |
-
|
|
|
|
|
|
|
103 |
|
104 |
# Set the model to evaluation mode
|
105 |
model_nn.eval()
|
|
|
29 |
- Makes random predictions from the label space (0-7)
|
30 |
- Used as a baseline for comparison
|
31 |
"""
|
|
|
|
|
32 |
|
33 |
# Get space info
|
34 |
username, space_url = get_space_info()
|
|
|
96 |
x = self.fc3(x) # Output raw logits
|
97 |
return x
|
98 |
|
99 |
+
try :
|
100 |
+
model_nn = torch.load("model_nn.pth", map_location=device)
|
101 |
+
except :
|
102 |
+
print(os.getcwd())
|
103 |
+
|
104 |
|
105 |
# Set the model to evaluation mode
|
106 |
model_nn.eval()
|