ZidongC commited on
Commit
57326a3
·
verified ·
1 Parent(s): 4cb286c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -33,7 +33,8 @@ DEVICE = 'cuda' if torch.cuda.is_available() else 'mps' if torch.backends.mps.is
33
  config = 'panda_large.yaml'
34
  with open(config, 'r') as f:
35
  config = yaml.load(f, Loader=yaml.FullLoader)
36
- state_dict = torch.load(os.path.join(config["load_weights_dir"], 'model.pth'), map_location="cpu")
 
37
  model = make(config['model'])
38
  if any(key.startswith('module') for key in state_dict.keys()):
39
  model = nn.DataParallel(model)
 
33
  config = 'panda_large.yaml'
34
  with open(config, 'r') as f:
35
  config = yaml.load(f, Loader=yaml.FullLoader)
36
+ hf_weight = hf_hub_download(repo_id=f"ZidongC/PanDA", filename=f"model.pth", repo_type="model")
37
+ state_dict = torch.load(hf_weight), map_location="cpu")
38
  model = make(config['model'])
39
  if any(key.startswith('module') for key in state_dict.keys()):
40
  model = nn.DataParallel(model)