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

Connection required after initialization #224

Open
ViniciusMeirelles opened this issue Dec 26, 2024 · 1 comment
Open

Connection required after initialization #224

ViniciusMeirelles opened this issue Dec 26, 2024 · 1 comment

Comments

@ViniciusMeirelles
Copy link

I want to run Melo on a closed system without internet connection. I first initialize Melo and let it download everything it needs, then I even generate one audio file to make sure it works. After that, I disable outgoing connections, and this causes speech synthesis to fail.

MaxRetryError('HTTPSConnectionPool(host=\'cdn-lfs.hf.co\', port=443): Max retries exceeded with url: /bert-base-uncased/68d45e234eb4a928074dfd868cead0219ab85354cc53d20e772753c6bb9169d3?response-content-disposition=inline%3B+filename*%3DUTF-8%27%27model.safetensors%3B+filename%3D%22model.safetensors%22%3B&Expires=1735500857&Policy=eyJTdGF0ZW1lbnQiOlt7IkNvbmRpdGlvbiI6eyJEYXRlTGVzc1RoYW4iOnsiQVdTOkVwb2NoVGltZSI6MTczNTUwMDg1N319LCJSZXNvdXJjZSI6Imh0dHBzOi8vY2RuLWxmcy5oZi5jby9iZXJ0LWJhc2UtdW5jYXNlZC82OGQ0NWUyMzRlYjRhOTI4MDc0ZGZkODY4Y2VhZDAyMTlhYjg1MzU0Y2M1M2QyMGU3NzI3NTNjNmJiOTE2OWQzP3Jlc3BvbnNlLWNvbnRlbnQtZGlzcG9zaXRpb249KiJ9XX0_&Signature=doW6dYUDL0Ed-c9lXmekerqPhaZeba-xvjQBM6pv71~qb0CJ0C9cUo-a52UDE0WpoohpMpK2mGAvFXZWxZfBa0Z9rVM2DuJt-rWwGlfMsQrDrNGdaBJP-iMblbnkx3~9-yvukMwFBMyu4Bc2-JCJe4lAodZ1OnIzu4xFkLQAz8F6P8LCAPbNHBxn1fhBbtYgUS6Wr7ItPshvkcy3-tpDuFAnWnpEvoK9IHyzJeyFfx5LEJfQUffSh21XgwqvEZCvj8wQKC6XDei~hAN9DrCVjAsiNL9I5EK9Jnu8-0~dNJLG31w8emKZkJAh68T2Sucl5NN996ip602ELL5tNHMNig__&Key-Pair-Id=K3RPWS32NSSJCE (Caused by NameResolutionError("<urllib3.connection.HTTPSConnection object at 0x7fbf34818220>: Failed to resolve \'cdn-lfs.hf.co\' ([Errno -3] Temporary failure in name resolution)"))'), '(Request ID: ac9d0a58-cc00-4c4d-b0e2-9f9f305b2c2a)'

As you can see, it's trying to download Bert. But looking at the code, once the Bert model is downloaded once, it shouldn't try to download again:

if model is None:

@a-e-i
Copy link

a-e-i commented Jan 4, 2025

I ran into this too and found a workaround. After running melotts command to generate audio, I then found the file file_download.py in the huggingface_hub dependency, and in the function _hf_hub_download_to_cache_dir, where it calls _get_metadata_or_catch_error, I edited the local_files_only parameter to be True:

    # Try to get metadata (etag, commit_hash, url, size) from the server.
    # If we can't, a HEAD request error is returned.
    (url_to_download, etag, commit_hash, expected_size, head_call_error) = _get_metadata_or_catch_error(
        repo_id=repo_id,
        filename=filename,
        repo_type=repo_type,
        revision=revision,
        endpoint=endpoint,
        proxies=proxies,
        etag_timeout=etag_timeout,
        headers=headers,
        token=token,
        local_files_only=True,
        storage_folder=storage_folder,
        relative_filename=relative_filename,
    )

Then it worked offline. It's a hack, but maybe helpful to you.

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

2 participants