name: WhisperKit Evals Dataset Update Workflow on: schedule: - cron: "0 * * * *" workflow_dispatch: jobs: update-datasets: runs-on: ubuntu-latest permissions: contents: write steps: - uses: actions/checkout@v4 - name: Set up Python uses: actions/setup-python@v5 with: python-version: "3.11" - name: Install dependencies run: | python -m pip install --upgrade pip pip install huggingface_hub requests - name: Upload relevant dashboard data for report generation uses: actions/upload-artifact@v4 with: name: report_data path: | dashboard_data/performance_data.json dashboard_data/support_data.csv dashboard_data/version.json - name: Check dataset updates id: check_updates env: HF_TOKEN: ${{ secrets.HF_TOKEN }} run: python .github/scripts/check_dataset_update.py - name: Save workflow data run: | mkdir -p ./workflow_data echo "${{ steps.check_updates.outputs.has_updates }}" > ./workflow_data/has_updates.txt - name: Upload workflow data uses: actions/upload-artifact@v4 with: name: workflow_data path: workflow_data/ overwrite: true - name: Install full requirements if: steps.check_updates.outputs.has_updates == 'true' run: | pip install -r requirements.txt - name: Run generate script if: steps.check_updates.outputs.has_updates == 'true' run: | make update-performance-data - name: Commit and push if changed if: steps.check_updates.outputs.has_updates == 'true' env: GH_TOKEN: ${{ secrets.BOT_TOKEN }} GH_USERNAME: ${{ secrets.BOT_USERNAME }} HF_TOKEN: ${{ secrets.HF_TOKEN }} run: | git config --global user.email "bots@takeargmax.com" git config --global user.name $GH_USERNAME git remote set-url origin https://x-access-token:${GH_TOKEN}@github.com/${GITHUB_REPOSITORY}.git git add . git commit -m "update dataset files" || echo "No changes to commit" git push -f git push -f https://HF_USERNAME:$HF_TOKEN@huggingface.co/spaces/argmaxinc/whisperkit-benchmarks generate-report: needs: update-datasets runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 with: ref: main fetch-depth: 0 - name: Set up Python uses: actions/setup-python@v5 with: python-version: "3.11" - name: Download workflow data uses: actions/download-artifact@v4 with: name: workflow_data path: workflow_data - name: Check updates status id: check run: | HAS_UPDATES=$(cat workflow_data/has_updates.txt) echo "has_updates=$HAS_UPDATES" >> $GITHUB_OUTPUT - name: Download report data if: steps.check.outputs.has_updates == 'true' uses: actions/download-artifact@v4 with: name: report_data path: report_data - name: Install dependencies if: steps.check.outputs.has_updates == 'true' run: | python -m pip install --upgrade pip pip install pandas beautifulsoup4 - name: Process report if: steps.check.outputs.has_updates == 'true' id: report run: python .github/scripts/process_report.py - name: Post to a Slack Channel if: steps.check.outputs.has_updates == 'true' id: slack_message uses: slackapi/slack-github-action@v1.27.0 with: channel-id: ${{ secrets.SLACK_CHANNEL_ID }} payload: | ${{ steps.report.outputs.slack_message_payload }} env: SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} - name: Send Thread Message if: steps.check.outputs.has_updates == 'true' uses: slackapi/slack-github-action@v1.27.0 with: channel-id: ${{ secrets.SLACK_CHANNEL_ID }} payload: | { "thread_ts": "${{ steps.slack_message.outputs.ts }}", "text": "${{ steps.report.outputs.performance_message }}" } env: SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}