Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -12,7 +12,7 @@ device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
|
12 |
|
13 |
print('Number fo parameters: {}'.format(model.num_parameters()))
|
14 |
model.to(device)
|
15 |
-
model_dict = torch.load('Model_example.pth.tar')['state_dict']
|
16 |
# save model
|
17 |
model.load_state_dict(model_dict, strict=True)
|
18 |
model.eval()
|
@@ -101,4 +101,4 @@ iface = gr.Interface(fn=process_images,
|
|
101 |
article=md,
|
102 |
examples=examples)
|
103 |
|
104 |
-
iface.launch(debug=True
|
|
|
12 |
|
13 |
print('Number fo parameters: {}'.format(model.num_parameters()))
|
14 |
model.to(device)
|
15 |
+
model_dict = torch.load('Model_example.pth.tar', map_location=device)['state_dict']
|
16 |
# save model
|
17 |
model.load_state_dict(model_dict, strict=True)
|
18 |
model.eval()
|
|
|
101 |
article=md,
|
102 |
examples=examples)
|
103 |
|
104 |
+
iface.launch(debug=True)
|