Spaces:
Running
Running
update
Browse files
examples/mpnet_aishell/step_2_train_model.py
CHANGED
@@ -182,11 +182,11 @@ def main():
|
|
182 |
|
183 |
logger.info(f"load state dict for generator.")
|
184 |
with open(generator_pt.as_posix(), "rb") as f:
|
185 |
-
state_dict = torch.load(f, map_location="cpu")
|
186 |
generator.load_state_dict(state_dict, strict=True)
|
187 |
logger.info(f"load state dict for discriminator.")
|
188 |
with open(discriminator_pt.as_posix(), "rb") as f:
|
189 |
-
state_dict = torch.load(f, map_location="cpu")
|
190 |
discriminator.load_state_dict(state_dict, strict=True)
|
191 |
|
192 |
# optimizer
|
|
|
182 |
|
183 |
logger.info(f"load state dict for generator.")
|
184 |
with open(generator_pt.as_posix(), "rb") as f:
|
185 |
+
state_dict = torch.load(f, map_location="cpu", weights_only=True)
|
186 |
generator.load_state_dict(state_dict, strict=True)
|
187 |
logger.info(f"load state dict for discriminator.")
|
188 |
with open(discriminator_pt.as_posix(), "rb") as f:
|
189 |
+
state_dict = torch.load(f, map_location="cpu", weights_only=True)
|
190 |
discriminator.load_state_dict(state_dict, strict=True)
|
191 |
|
192 |
# optimizer
|