File size: 700 Bytes
3232d64
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import os
import dotenv
import logging

# .env dosyasını yükle
dotenv.load_dotenv()

from huggingface_hub import HfApi

# TOKEN is automatically set when running in Hugging Face Spaces
# For local development, use the token from the .env file
TOKEN = os.environ.get("HFTOKEN", os.environ.get("HF_TOKEN", os.environ.get("HUGGINGFACE_TOKEN", os.environ.get("TOKEN", None))))

# Replace these with your custom repository paths
OWNER = "newmindai"
REPO_ID = f"{OWNER}/mezura"

CACHE_PATH = os.getenv("HF_HOME", ".")

# Initialize API if TOKEN is available, otherwise set to None
try:
    API = HfApi(token=TOKEN)
except Exception as e:
    logging.warning("Could not initialize HfApi")
    API = None