From b27e8383763e15e32c826424f9512fac705ca808 Mon Sep 17 00:00:00 2001 From: Pepijn Date: Thu, 16 Apr 2026 11:54:35 +0200 Subject: [PATCH] fix(profiling): publish preview rows to existing dataset --- .github/workflows/model_profiling.yml | 2 +- scripts/ci/run_model_profiling.py | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/model_profiling.yml b/.github/workflows/model_profiling.yml index 8dccd60f7..fd0c23eee 100644 --- a/.github/workflows/model_profiling.yml +++ b/.github/workflows/model_profiling.yml @@ -81,7 +81,7 @@ jobs: HF_USER_TOKEN: ${{ secrets.LEROBOT_HF_USER }} PROFILE_MODE: ${{ github.event_name == 'pull_request' && 'summary' || github.event.inputs.profile_mode || 'trace' }} POLICY_FILTER: ${{ github.event_name == 'pull_request' && 'act' || github.event.inputs.policies || '' }} - RESULTS_REPO: ${{ github.event_name == 'pull_request' && 'model-profiling-history-preview' || github.event.inputs.results_repo || 'model-profiling-history' }} + RESULTS_REPO: ${{ github.event.inputs.results_repo || 'model-profiling-history' }} SHOULD_PUBLISH: ${{ github.event_name == 'pull_request' || github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.event.inputs.publish_results == 'true') }} steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 diff --git a/scripts/ci/run_model_profiling.py b/scripts/ci/run_model_profiling.py index 24099fab9..24f457772 100644 --- a/scripts/ci/run_model_profiling.py +++ b/scripts/ci/run_model_profiling.py @@ -61,7 +61,12 @@ def upload_targets( commit_message: str | None = None, ) -> dict[str, str]: api = HfApi(token=token) - api.create_repo(repo_id=repo_id, repo_type=repo_type, private=private, exist_ok=True) + try: + repo_exists = api.repo_exists(repo_id=repo_id, repo_type=repo_type) + except Exception: + repo_exists = True + if not repo_exists: + api.create_repo(repo_id=repo_id, repo_type=repo_type, private=private, exist_ok=True) uploaded: dict[str, str] = {} for target in targets: api.upload_file(