Skip to content

Commit 16019be

Browse files
authored
Merge pull request #964 from IAHispano/formatter/main
chore(format): run black on main
2 parents 0fcd2d8 + d2ae08d commit 16019be

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

rvc/lib/predictors/FCPE.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -728,7 +728,9 @@ def __init__(self, model_path, device=None, dtype=torch.float32):
728728
if device is None:
729729
device = "cuda" if torch.cuda.is_available() else "cpu"
730730
self.device = device
731-
ckpt = torch.load(model_path, map_location=torch.device(self.device), weights_only=True)
731+
ckpt = torch.load(
732+
model_path, map_location=torch.device(self.device), weights_only=True
733+
)
732734
self.args = DotDict(ckpt["config"])
733735
self.dtype = dtype
734736
model = FCPE(

rvc/train/train.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -469,23 +469,31 @@ def run(
469469
print(f"Loaded pretrained (G) '{pretrainG}'")
470470
if hasattr(net_g, "module"):
471471
net_g.module.load_state_dict(
472-
torch.load(pretrainG, map_location="cpu", weights_only=True)["model"]
472+
torch.load(pretrainG, map_location="cpu", weights_only=True)[
473+
"model"
474+
]
473475
)
474476
else:
475477
net_g.load_state_dict(
476-
torch.load(pretrainG, map_location="cpu", weights_only=True)["model"]
478+
torch.load(pretrainG, map_location="cpu", weights_only=True)[
479+
"model"
480+
]
477481
)
478482

479483
if pretrainD != "" and pretrainD != "None":
480484
if rank == 0:
481485
print(f"Loaded pretrained (D) '{pretrainD}'")
482486
if hasattr(net_d, "module"):
483487
net_d.module.load_state_dict(
484-
torch.load(pretrainD, map_location="cpu", weights_only=True)["model"]
488+
torch.load(pretrainD, map_location="cpu", weights_only=True)[
489+
"model"
490+
]
485491
)
486492
else:
487493
net_d.load_state_dict(
488-
torch.load(pretrainD, map_location="cpu", weights_only=True)["model"]
494+
torch.load(pretrainD, map_location="cpu", weights_only=True)[
495+
"model"
496+
]
489497
)
490498

491499
# Initialize schedulers

0 commit comments

Comments
 (0)