Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use customized trained models? #52

Open
ScottishFold007 opened this issue May 11, 2024 · 1 comment
Open

How to use customized trained models? #52

ScottishFold007 opened this issue May 11, 2024 · 1 comment

Comments

@ScottishFold007
Copy link

I trained a vocos model with a model I trained myself, how do I use it? I see that the existing model loaded is in pytorch_model.bin format, and the parameters in it are named differently than the directly trained one? Can you give me an example of how to use it, thanks!

@patriotyk
Copy link

def load_vocos(checkpoint_path, config_path, device):
    model = Vocos.from_hparams(config_path).to(device)

    raw_model = torch.load(checkpoint_path, map_location=device)
    raw_model = raw_model if 'state_dict' not in raw_model else raw_model['state_dict']
    model.load_state_dict(raw_model, strict=False)
    model.eval()
    return model

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@patriotyk @ScottishFold007 and others