(checkpoint_path, config_path)
| 20 | |
| 21 | |
| 22 | def 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 | |
| 37 | class HighGAN(BaseVocoder): |
| 38 | def __init__(self): |
no test coverage detected