Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -6,7 +6,7 @@ import torchvision.models as models
|
|
| 6 |
import torch.nn as nn
|
| 7 |
|
| 8 |
|
| 9 |
-
class
|
| 10 |
def __init__(self):
|
| 11 |
super(DummyModel, self).__init__()
|
| 12 |
|
|
@@ -81,7 +81,8 @@ class DummyModel(nn.Module):
|
|
| 81 |
|
| 82 |
return dec4
|
| 83 |
|
| 84 |
-
|
|
|
|
| 85 |
model_weights = torch.load('model.pth', map_location=device)
|
| 86 |
model.load_state_dict(model_weights)
|
| 87 |
model = model.to(device)
|
|
|
|
| 6 |
import torch.nn as nn
|
| 7 |
|
| 8 |
|
| 9 |
+
class ColorizingModel(nn.Module):
|
| 10 |
def __init__(self):
|
| 11 |
super(DummyModel, self).__init__()
|
| 12 |
|
|
|
|
| 81 |
|
| 82 |
return dec4
|
| 83 |
|
| 84 |
+
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
|
| 85 |
+
model = ColorizingModel()
|
| 86 |
model_weights = torch.load('model.pth', map_location=device)
|
| 87 |
model.load_state_dict(model_weights)
|
| 88 |
model = model.to(device)
|