MorenoLaQuatra commited on
Commit
9ccc55b
1 Parent(s): ccd5ee8

Map location device

Browse files
__pycache__/dual_regression_model.cpython-310.pyc CHANGED
Binary files a/__pycache__/dual_regression_model.cpython-310.pyc and b/__pycache__/dual_regression_model.cpython-310.pyc differ
 
app.py CHANGED
@@ -16,7 +16,7 @@ clf_pipeline = pipeline("text-classification", model=clf_model, tokenizer=clf_to
16
  reg_model_tag = "distilbert-base-multilingual-cased"
17
  reg_model_folder = "reg_model/regression_model.pt"
18
  reg_model = DualRegressionModel(model_name_or_path=reg_model_tag)
19
- reg_model.load_model(reg_model_folder, map_location=torch.device('cpu'))
20
 
21
 
22
  # define the function to be used for prediction
 
16
  reg_model_tag = "distilbert-base-multilingual-cased"
17
  reg_model_folder = "reg_model/regression_model.pt"
18
  reg_model = DualRegressionModel(model_name_or_path=reg_model_tag)
19
+ reg_model.load_model(reg_model_folder)
20
 
21
 
22
  # define the function to be used for prediction
dual_regression_model.py CHANGED
@@ -91,4 +91,4 @@ class DualRegressionModel(nn.Module):
91
  """
92
 
93
  # load the state dict
94
- self.load_state_dict(torch.load(path))
 
91
  """
92
 
93
  # load the state dict
94
+ self.load_state_dict(torch.load(path, map_location=torch.device("cpu")))