gemelo-ai / vocos

Vocos: Closing the gap between time-domain and Fourier-based neural vocoders for high-quality audio synthesis
https://gemelo-ai.github.io/vocos/
MIT License
771 stars 88 forks source link

about the install problems #32

Open yyh565655555 opened 11 months ago

yyh565655555 commented 11 months ago

i follow the remead install the vocos, but when testing samples, there is a problem: LocalEntryNotFoundError: An error happened while trying to locate the file on the Hub and we cannot find the requested files in the local cache. Please check your connection and try again or make sure your Internet connection is on. i also download the the pytorch file, but vocos.from_pretrain() how to load the local files?

hualizhou167 commented 6 months ago
add a `local_dir` parameter for Vocos class may work:
@classmethod
    def from_pretrained(cls, local_dir: str, repo_id: str = None, revision: Optional[str] = None) -> Vocos:
        """
        Class method to create a new Vocos model instance from a pre-trained model stored in the Hugging Face model hub.
        """
        if local_dir:
            config_path = os.path.join(local_dir, "config.yaml")
            model_path = os.path.join(local_dir, "pytorch_model.bin")
        elif repo_id:
            config_path = hf_hub_download(repo_id=repo_id, filename="config.yaml", revision=revision)
            model_path = hf_hub_download(repo_id=repo_id, filename="pytorch_model.bin", revision=revision)