File size: 1,045 Bytes
f1b0176 | 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 | import os
from huggingface_hub import HfApi
from training_coach.storage import HuggingFaceDatasetHistoryStore
def main():
repo_id = os.getenv("HF_HISTORY_DATASET_REPO", "").strip()
token = os.getenv("HF_TOKEN")
path_in_repo = os.getenv("HF_HISTORY_FILE", "completed_sessions.json")
if not repo_id:
raise SystemExit("Set HF_HISTORY_DATASET_REPO before running this check.")
if not token:
raise SystemExit("Set HF_TOKEN before running this check.")
api = HfApi()
repo_info = api.repo_info(repo_id=repo_id, repo_type="dataset", token=token)
print(f"Dataset repo reachable: {repo_info.id}")
store = HuggingFaceDatasetHistoryStore(
repo_id=repo_id,
token=token,
path_in_repo=path_in_repo,
api=api,
)
sessions = store.load_completed_sessions()
print(f"History file: {path_in_repo}")
print(f"Completed sessions loaded: {len(sessions)}")
print("HF storage read check passed. No upload was performed.")
if __name__ == "__main__":
main()
|