seungheondoh
commited on
Commit
β’
1fe02e5
1
Parent(s):
59ef0c8
error fix
Browse files
app.py
CHANGED
@@ -21,7 +21,8 @@ model = BartCaptionModel(max_length = 128)
|
|
21 |
pretrained_object = torch.load('./transfer.pth', map_location='cpu')
|
22 |
state_dict = pretrained_object['state_dict']
|
23 |
model.load_state_dict(state_dict)
|
24 |
-
torch.cuda.
|
|
|
25 |
model = model.cuda(device)
|
26 |
model.eval()
|
27 |
|
|
|
21 |
pretrained_object = torch.load('./transfer.pth', map_location='cpu')
|
22 |
state_dict = pretrained_object['state_dict']
|
23 |
model.load_state_dict(state_dict)
|
24 |
+
if torch.cuda.is_available():
|
25 |
+
torch.cuda.set_device(device)
|
26 |
model = model.cuda(device)
|
27 |
model.eval()
|
28 |
|