fix(profiling): publish preview rows to existing dataset

This commit is contained in:
Pepijn
2026-04-16 11:54:35 +02:00
parent 40470648d1
commit b27e838376
2 changed files with 7 additions and 2 deletions
+1 -1
View File
@@ -81,7 +81,7 @@ jobs:
HF_USER_TOKEN: ${{ secrets.LEROBOT_HF_USER }} HF_USER_TOKEN: ${{ secrets.LEROBOT_HF_USER }}
PROFILE_MODE: ${{ github.event_name == 'pull_request' && 'summary' || github.event.inputs.profile_mode || 'trace' }} 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 || '' }} 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') }} SHOULD_PUBLISH: ${{ github.event_name == 'pull_request' || github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.event.inputs.publish_results == 'true') }}
steps: steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
+6 -1
View File
@@ -61,7 +61,12 @@ def upload_targets(
commit_message: str | None = None, commit_message: str | None = None,
) -> dict[str, str]: ) -> dict[str, str]:
api = HfApi(token=token) 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] = {} uploaded: dict[str, str] = {}
for target in targets: for target in targets:
api.upload_file( api.upload_file(