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

Offline usage? #60

Open
George0828Zhang opened this issue Oct 24, 2024 · 0 comments
Open

Offline usage? #60

George0828Zhang opened this issue Oct 24, 2024 · 0 comments

Comments

@George0828Zhang
Copy link

Tried to load model locally using this:

def load_vocos(path, device):
    config_path = os.path.join(path, 'config.yaml')
    model_path = os.path.join(path, 'pytorch_model.bin')
    model = Vocos.from_hparams(config_path)
    state_dict = torch.load(model_path, map_location="cpu")
    if isinstance(model.feature_extractor, EncodecFeatures):
        encodec_parameters = {
            "feature_extractor.encodec." + key: value
            for key, value in model.feature_extractor.encodec.state_dict().items()
        }
        state_dict.update(encodec_parameters)
    model.load_state_dict(state_dict)
    model.eval()
    model.to(device)
    return model

However, this line is hard-coded to load pretrained encodec, preventing offline usage:

self.encodec = encodec(pretrained=True)

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

1 participant