sumesh4C commited on
Commit
0de3206
·
verified ·
1 Parent(s): 33cdcfa

Update tasks/text.py

Browse files
Files changed (1) hide show
  1. tasks/text.py +5 -4
tasks/text.py CHANGED
@@ -96,10 +96,11 @@ async def evaluate_text(request: TextEvaluationRequest):
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
 
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