| 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() | |