Spaces:
Runtime error
Runtime error
ChongMou
commited on
Commit
•
b301b55
1
Parent(s):
6d5e6db
Update demo/model.py
Browse files- demo/model.py +7 -1
demo/model.py
CHANGED
@@ -150,7 +150,9 @@ class Model_all:
|
|
150 |
sd = pl_sd["state_dict"]
|
151 |
else:
|
152 |
sd = pl_sd
|
|
|
153 |
self.base_model.load_state_dict(sd, strict=False)
|
|
|
154 |
self.current_base = base_model
|
155 |
# del sd
|
156 |
# del pl_sd
|
@@ -224,7 +226,9 @@ class Model_all:
|
|
224 |
sd = pl_sd["state_dict"]
|
225 |
else:
|
226 |
sd = pl_sd
|
227 |
-
self.base_model
|
|
|
|
|
228 |
self.current_base = base_model
|
229 |
con_strength = int((1-con_strength)*50)
|
230 |
if fix_sample == 'True':
|
@@ -294,7 +298,9 @@ class Model_all:
|
|
294 |
sd = pl_sd["state_dict"]
|
295 |
else:
|
296 |
sd = pl_sd
|
|
|
297 |
self.base_model.load_state_dict(sd, strict=False)
|
|
|
298 |
self.current_base = base_model
|
299 |
con_strength = int((1-con_strength)*50)
|
300 |
if fix_sample == 'True':
|
|
|
150 |
sd = pl_sd["state_dict"]
|
151 |
else:
|
152 |
sd = pl_sd
|
153 |
+
self.base_model = self.base_model.cpu()
|
154 |
self.base_model.load_state_dict(sd, strict=False)
|
155 |
+
self.base_model = self.base_model.cuda()
|
156 |
self.current_base = base_model
|
157 |
# del sd
|
158 |
# del pl_sd
|
|
|
226 |
sd = pl_sd["state_dict"]
|
227 |
else:
|
228 |
sd = pl_sd
|
229 |
+
self.base_model = self.base_model.cpu()
|
230 |
+
self.base_model.load_state_dict(sd, strict=False)
|
231 |
+
self.base_model = self.base_model.cuda()
|
232 |
self.current_base = base_model
|
233 |
con_strength = int((1-con_strength)*50)
|
234 |
if fix_sample == 'True':
|
|
|
298 |
sd = pl_sd["state_dict"]
|
299 |
else:
|
300 |
sd = pl_sd
|
301 |
+
self.base_model = self.base_model.cpu()
|
302 |
self.base_model.load_state_dict(sd, strict=False)
|
303 |
+
self.base_model = self.base_model.cuda()
|
304 |
self.current_base = base_model
|
305 |
con_strength = int((1-con_strength)*50)
|
306 |
if fix_sample == 'True':
|