Download src/core/authentication.py from tomvries/tts: direct link, hf CLI and curl.
- Browser
- Download file 674 Bytes
-
https://huggingface.co/spaces/tomvries/tts/resolve/main/src/core/authentication.py
- Command line
-
hf download hf://spaces/tomvries/tts/src/core/authentication.py
-
curl -L -o authentication.py https://huggingface.co/spaces/tomvries/tts/resolve/main/src/core/authentication.py
674 Bytes
| # | |
| # SPDX-FileCopyrightText: Hadad <hadad@linuxmail.org> | |
| # SPDX-License-Identifier: Apache-2.0 | |
| # | |
| from config import HF_TOKEN | |
| from huggingface_hub import login | |
| def authenticate_huggingface(): | |
| if HF_TOKEN: | |
| try: | |
| login(token=HF_TOKEN, add_to_git_credential=False) | |
| print("Authenticated with Hugging Face") | |
| except Exception as authentication_error: | |
| print(f"Hugging Face authentication failed: {authentication_error}") | |
| print("Voice cloning may not be available") | |
| else: | |
| print("Missing Hugging Face authentication required for the license agreement") | |
| def get_huggingface_token(): | |
| return HF_TOKEN |