MCPcopy Create free account
hub / github.com/MoonInTheRiver/DiffSinger / load_model_config

Function load_model_config

usr/singingvocoder/highgan.py:22–35  ·  view source on GitHub ↗
(checkpoint_path, config_path)

Source from the content-addressed store, hash-verified

20
21
22def load_model_config(checkpoint_path, config_path):
23 with open(config_path) as f:
24 config = yaml.load(f, Loader=yaml.Loader)
25
26 model_class = getattr(
27 models,
28 config.get("generator_type", "ParallelWaveGANGenerator_source"))
29 model = model_class(**config["generator_params"])
30 model.load_state_dict(
31 torch.load(checkpoint_path, map_location="cpu")["model"]["generator"])
32 logging.info(f"Loaded model parameters from {checkpoint_path}.")
33 model.remove_weight_norm()
34
35 return model, config
36
37class HighGAN(BaseVocoder):
38 def __init__(self):

Callers 1

__init__Method · 0.85

Calls 1

remove_weight_normMethod · 0.45

Tested by

no test coverage detected