File size: 1,093 Bytes
e7abd9e
 
 
 
 
 
 
 
 
 
 
 
 
 
ca11711
e7abd9e
 
 
 
 
 
 
 
 
 
ca11711
e7abd9e
c33fa24
e7abd9e
 
 
 
 
 
47f193c
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
27
28
29
30
31
32
33
34
35
36
"""
Hugging Face configuration module
"""
import os
import logging
from typing import Optional
from huggingface_hub import HfApi
from pathlib import Path
from app.core.cache import cache_config
from app.utils.logging import LogFormatter

logger = logging.getLogger(__name__)

# Organization or user who owns the datasets
HF_ORGANIZATION = os.environ.get("HF_ORGANIZATION", "ymk00")

# Get HF token directly from environment
HF_TOKEN = os.environ.get("HF_TOKEN")
if not HF_TOKEN:
    logger.warning("HF_TOKEN not found in environment variables. Some features may be limited.")

# Initialize HF API
API = HfApi(token=HF_TOKEN)

# Repository configuration
HF_AGGREGATED = os.environ.get("HF_AGGREGATED", "dataset-test")
QUEUE_REPO = f"{HF_ORGANIZATION}/requests"
AGGREGATED_REPO = f"{HF_ORGANIZATION}/{HF_AGGREGATED}"
VOTES_REPO = f"{HF_ORGANIZATION}/votes"
MAINTAINERS_HIGHLIGHT_REPO = f"{HF_ORGANIZATION}/maintainers-highlight"

# File paths from cache config
VOTES_PATH = cache_config.votes_file
EVAL_REQUESTS_PATH = cache_config.eval_requests_file
MODEL_CACHE_DIR = cache_config.models_cache