Skip to content

Commit

Permalink
fix(api): use training device when loading Real ESRGAN model (#67)
Browse files Browse the repository at this point in the history
  • Loading branch information
ssube committed Jan 21, 2023
1 parent 5286c4f commit 8c9c99e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion api/onnx_web/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
model_path = environ.get('ONNX_WEB_MODEL_PATH',
path.join('..', 'models'))
training_device = 'cuda' if torch.cuda.is_available() else 'cpu'
map_location = None if torch.cuda.is_available() else torch.device('cpu')
map_location = torch.device(training_device)

@torch.no_grad()
def convert_real_esrgan(name: str, url: str, scale: int, opset: int):
Expand Down

0 comments on commit 8c9c99e

Please sign in to comment.