Skip to content

Commit

Permalink
Merge branch 'main' into absolute-link-images
Browse files Browse the repository at this point in the history
abdulfatir authored Dec 2, 2024
2 parents da429af + 86f755c commit 9cd0abf
Showing 2 changed files with 18 additions and 4 deletions.
11 changes: 9 additions & 2 deletions .github/workflows/eval-model.yml
Original file line number Diff line number Diff line change
@@ -5,11 +5,18 @@ on:
# Runs only with read privilages for the GITHUB_TOKEN
pull_request:
branches: ["main"] # Run on PRs to main branch
types:
- opened # When a PR is created
- reopened # When a closed PR is reopened
- synchronize # When new commits are pushed to the PR
- labeled # When a label is added to the PR

jobs:
evaluate-and-post:
if: contains(github.event.pull_request.labels.*.name, 'run-eval') # Only run if 'run-eval' label is added
runs-on: ubuntu-latest
env:
RESULTS_CSV: "eval-ci-metrics-${{ github.event.pull_request.number }}.csv"

steps:
- name: Checkout Repository
@@ -24,12 +31,12 @@ jobs:
run: pip install ".[evaluation]" -f https://download.pytorch.org/whl/cpu/torch_stable.html

- name: Run Eval Script
run: python scripts/evaluation/evaluate.py ci/evaluate/backtest_config.yaml eval-ci-metrics.csv --chronos-model-id=amazon/chronos-bolt-small --device=cpu --torch-dtype=float32
run: python scripts/evaluation/evaluate.py ci/evaluate/backtest_config.yaml $RESULTS_CSV --chronos-model-id=amazon/chronos-bolt-small --device=cpu --torch-dtype=float32

- name: Upload CSV
uses: actions/upload-artifact@v4
with:
name: eval-metrics
path: eval-ci-metrics.csv
path: ${{ env.RESULTS_CSV }}
retention-days: 1
overwrite: true
11 changes: 9 additions & 2 deletions .github/workflows/eval-pr-comment.yml
Original file line number Diff line number Diff line change
@@ -29,12 +29,19 @@ jobs:

- name: Display structure of downloaded files
run: ls -R

- name: Extract PR number from file name
id: extract-pr
run: |
FILE_NAME=$(ls eval-metrics-artifact/eval-ci-metrics-*.csv)
PR_NUMBER=$(echo $FILE_NAME | sed -E 's/.*eval-ci-metrics-(.*).csv/\1/')
echo "PR_NUMBER=$PR_NUMBER" >> $GITHUB_ENV
- name: Read CSV
id: csv
uses: juliangruber/read-file-action@v1
with:
path: eval-metrics-artifact/eval-ci-metrics.csv
path: eval-metrics-artifact/eval-ci-metrics-${{ env.PR_NUMBER }}.csv

- name: Create Markdown Table
uses: petems/csv-to-md-table-action@master
@@ -47,7 +54,7 @@ jobs:
with:
token: ${{ secrets.GITHUB_TOKEN }}
repository: ${{ github.repository }}
issue-number: ${{ github.event.pull_request.number }}
issue-number: ${{ env.PR_NUMBER }}
body: |
### Evaluation Metrics
${{steps.csv-table-output.outputs.markdown-table}}

0 comments on commit 9cd0abf

Please sign in to comment.