Skip to content

Commit

Permalink
added cpu parameter support (#423)
Browse files Browse the repository at this point in the history
  • Loading branch information
kadirnar committed Aug 5, 2022
1 parent 72a9c96 commit 1560034
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion hubconf.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def custom(path_or_model='path/to/model.pt', autoshape=True):
Returns:
pytorch model
"""
model = torch.load(path_or_model) if isinstance(path_or_model, str) else path_or_model # load checkpoint
model = torch.load(path_or_model, map_location=torch.device('cpu')) if isinstance(path_or_model, str) else path_or_model # load checkpoint
if isinstance(model, dict):
model = model['ema' if model.get('ema') else 'model'] # load model

Expand Down

0 comments on commit 1560034

Please sign in to comment.