Spaces:
Sleeping
Sleeping
cdborinstein commited on
Commit ·
60f144c
1
Parent(s): f296a88
Fix backup: pass HF token explicitly to CommitScheduler
Browse files- Pass token directly to CommitScheduler for reliable auth
- Change default sync interval from 10 to 2 minutes
- backup_to_hub.py +3 -2
backup_to_hub.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
"""
|
| 2 |
Automatic backup of Argilla annotations to HF Dataset.
|
| 3 |
-
Runs as a honcho-managed process, syncs every
|
| 4 |
"""
|
| 5 |
import os
|
| 6 |
import sys
|
|
@@ -12,7 +12,7 @@ from datetime import datetime
|
|
| 12 |
# Configuration - use writable directory under /home/argilla
|
| 13 |
EXPORT_DIR = Path("/home/argilla/exports")
|
| 14 |
BACKUP_REPO = os.environ.get("BACKUP_DATASET_REPO", "argus-systems/vuln-preferences-data")
|
| 15 |
-
SYNC_INTERVAL = int(os.environ.get("SYNC_INTERVAL_MINUTES", "
|
| 16 |
ARGILLA_API_URL = "http://localhost:6900"
|
| 17 |
|
| 18 |
# Check for HF_TOKEN before importing heavy dependencies
|
|
@@ -33,6 +33,7 @@ scheduler = CommitScheduler(
|
|
| 33 |
repo_type="dataset",
|
| 34 |
folder_path=EXPORT_DIR,
|
| 35 |
every=SYNC_INTERVAL,
|
|
|
|
| 36 |
)
|
| 37 |
|
| 38 |
|
|
|
|
| 1 |
"""
|
| 2 |
Automatic backup of Argilla annotations to HF Dataset.
|
| 3 |
+
Runs as a honcho-managed process, syncs every 2 minutes by default.
|
| 4 |
"""
|
| 5 |
import os
|
| 6 |
import sys
|
|
|
|
| 12 |
# Configuration - use writable directory under /home/argilla
|
| 13 |
EXPORT_DIR = Path("/home/argilla/exports")
|
| 14 |
BACKUP_REPO = os.environ.get("BACKUP_DATASET_REPO", "argus-systems/vuln-preferences-data")
|
| 15 |
+
SYNC_INTERVAL = int(os.environ.get("SYNC_INTERVAL_MINUTES", "2"))
|
| 16 |
ARGILLA_API_URL = "http://localhost:6900"
|
| 17 |
|
| 18 |
# Check for HF_TOKEN before importing heavy dependencies
|
|
|
|
| 33 |
repo_type="dataset",
|
| 34 |
folder_path=EXPORT_DIR,
|
| 35 |
every=SYNC_INTERVAL,
|
| 36 |
+
token=hf_token,
|
| 37 |
)
|
| 38 |
|
| 39 |
|