-
Notifications
You must be signed in to change notification settings - Fork 2.6k
59 lines (51 loc) · 1.53 KB
/
test_eval.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
name: Run new evals
on:
workflow_dispatch:
pull_request:
branches:
- main
paths:
- 'evals/registry/**'
jobs:
check_files:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 0
lfs: true
- name: Install Git LFS
run: |
sudo apt-get install git-lfs
git lfs install
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pyyaml
pip install -e .
- name: Get list of new YAML files in evals/registry/evals
id: get_files
run: |
# Use environment files to store the output
git diff --name-only --diff-filter=A ${{ github.event.pull_request.base.sha }} ${{ github.sha }} | grep '^evals/registry/evals/.*\.yaml$' | xargs > new_files
echo "new_files=$(cat new_files)" >> $GITHUB_ENV
- name: Run oaieval command for each new YAML file
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
run: |
files="${{ env.new_files }}"
if [ -n "$files" ]; then
for file in $files; do
echo "Processing $file"
first_key=$(python .github/workflows/parse_yaml.py $file)
echo "Eval Name: $first_key"
oaieval dummy $first_key --max_samples 10
done
else
echo "No new YAML files found in evals/registry/evals"
fi