Xueqing commited on
Commit
3b86545
·
verified ·
1 Parent(s): b00622f

Update backend/utils/sync_datasets_locally.py

Browse files
backend/utils/sync_datasets_locally.py CHANGED
@@ -6,8 +6,10 @@ from pathlib import Path
6
  from huggingface_hub import HfApi, snapshot_download, upload_folder, create_repo
7
  from dotenv import load_dotenv
8
 
 
 
9
  # Configure source and destination usernames
10
- SOURCE_USERNAME = "TheFinAI"
11
  DESTINATION_USERNAME = "tfrere"
12
 
13
  # Get the backend directory path
@@ -29,7 +31,7 @@ DATASET_NAMES = [
29
  "votes",
30
  "results",
31
  "requests",
32
- "greek-contents",
33
  "maintainers-highlight",
34
  ]
35
 
@@ -107,9 +109,9 @@ def copy_datasets():
107
  try:
108
  logger.info("🔑 Checking authentication...")
109
  # Get token from .env file
110
- token = os.getenv("HF_TOKEN")
111
- if not token:
112
- raise ValueError("HF_TOKEN not found in .env file")
113
 
114
  # Process datasets sequentially
115
  results = []
 
6
  from huggingface_hub import HfApi, snapshot_download, upload_folder, create_repo
7
  from dotenv import load_dotenv
8
 
9
+ from app.config.hf_config import HF_TOKEN, HF_ORGANIZATION, HF_AGGREGATED
10
+
11
  # Configure source and destination usernames
12
+ SOURCE_USERNAME = HF_AGGREGATED
13
  DESTINATION_USERNAME = "tfrere"
14
 
15
  # Get the backend directory path
 
31
  "votes",
32
  "results",
33
  "requests",
34
+ HF_AGGREGATED,
35
  "maintainers-highlight",
36
  ]
37
 
 
109
  try:
110
  logger.info("🔑 Checking authentication...")
111
  # Get token from .env file
112
+ # token = os.getenv("HF_TOKEN")
113
+ # if not token:
114
+ # raise ValueError("HF_TOKEN not found in .env file")
115
 
116
  # Process datasets sequentially
117
  results = []