Update app.py
Browse files
app.py
CHANGED
|
@@ -19,7 +19,6 @@ if has_cuda:
|
|
| 19 |
model.to(device)
|
| 20 |
model.load_state_dict(load_checkpoint('base', device))
|
| 21 |
print('total base parameters', sum(x.numel() for x in model.parameters()))has_cuda = th.cuda.is_available()
|
| 22 |
-
device = th.device('cpu' if not has_cuda else 'cuda')
|
| 23 |
def show_images(batch: th.Tensor):
|
| 24 |
""" Display a batch of images inline. """
|
| 25 |
scaled = ((batch + 1)*127.5).round().clamp(0,255).to(th.uint8).cpu()
|
|
|
|
| 19 |
model.to(device)
|
| 20 |
model.load_state_dict(load_checkpoint('base', device))
|
| 21 |
print('total base parameters', sum(x.numel() for x in model.parameters()))has_cuda = th.cuda.is_available()
|
|
|
|
| 22 |
def show_images(batch: th.Tensor):
|
| 23 |
""" Display a batch of images inline. """
|
| 24 |
scaled = ((batch + 1)*127.5).round().clamp(0,255).to(th.uint8).cpu()
|