File size: 674 Bytes
5da0109 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
#
# 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 |