Serkan Ozturk
commited on
Commit
·
0a34c89
1
Parent(s):
c0fda56
fasd
Browse files- handler.py +4 -2
handler.py
CHANGED
|
@@ -3,11 +3,13 @@ import torch
|
|
| 3 |
import numpy as np
|
| 4 |
import torch.nn.functional as F
|
| 5 |
from serkan import SimpleUpscaleModel
|
|
|
|
| 6 |
class EndpointHandler():
|
| 7 |
-
def __init__(self, path="
|
| 8 |
# load the optimized model
|
| 9 |
self.model = SimpleUpscaleModel()
|
| 10 |
-
|
|
|
|
| 11 |
|
| 12 |
|
| 13 |
|
|
|
|
| 3 |
import numpy as np
|
| 4 |
import torch.nn.functional as F
|
| 5 |
from serkan import SimpleUpscaleModel
|
| 6 |
+
import os
|
| 7 |
class EndpointHandler():
|
| 8 |
+
def __init__(self, path="."):
|
| 9 |
# load the optimized model
|
| 10 |
self.model = SimpleUpscaleModel()
|
| 11 |
+
model_path = os.path.join(path, "model_weights.pth")
|
| 12 |
+
self.model.load_state_dict(torch.load(model_path))
|
| 13 |
|
| 14 |
|
| 15 |
|