microhum commited on
Commit
ccae047
·
1 Parent(s): e0c5376

map location model to cpu

Browse files
Files changed (1) hide show
  1. test_few_shot.py +1 -1
test_few_shot.py CHANGED
@@ -31,7 +31,7 @@ def test_main_model(opts):
31
  st.write("Loading Model Weight...")
32
  model_main = ModelMain(opts)
33
  path_ckpt = os.path.join(f"{opts.model_path}")
34
- model_main.load_state_dict(torch.load(path_ckpt)['model'], map_location=torch.device('cpu'))
35
  model_main.to(device)
36
  model_main.eval()
37
  with torch.no_grad():
 
31
  st.write("Loading Model Weight...")
32
  model_main = ModelMain(opts)
33
  path_ckpt = os.path.join(f"{opts.model_path}")
34
+ model_main.load_state_dict(torch.load(path_ckpt, map_location=torch.device('cpu'))['model'])
35
  model_main.to(device)
36
  model_main.eval()
37
  with torch.no_grad():