Skip to content

Commit

Permalink
added cpu parameter support (WongKinYiu#423)
Browse files Browse the repository at this point in the history
  • Loading branch information
kadirnar authored and nelioasousa committed Apr 26, 2024
1 parent 1a6aa0f commit 824eba0
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 824eba0

Please # to comment.