name: Nightly Evaluation Run | |
on: | |
schedule: | |
- cron: '0 3 * * *' # Run at 3am UTC every day | |
workflow_dispatch: # Allow manual triggering | |
jobs: | |
run-evals: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements_dev.txt | |
- name: Run evaluations | |
env: | |
OPENROUTER_API_KEY: ${{ secrets.OPENROUTER_API_KEY }} | |
ELEVENLABS_API_KEY: ${{ secrets.ELEVENLABS_API_KEY }} | |
HUGGINGFACE_ACCESS_TOKEN: ${{ secrets.HUGGINGFACE_ACCESS_TOKEN }} | |
run: | | |
cd evals | |
python main.py | |
- name: Commit changes | |
run: | | |
git config --local user.email "github-actions[bot]@users.noreply.github.com" | |
git config --local user.name "github-actions[bot]" | |
git add results.json models.json languages.json | |
git commit -m "Update evaluation results [skip ci]" || echo "No changes to commit" | |
git push | |
- name: Install Hugging Face dependencies | |
run: | | |
python -m pip install huggingface_hub | |
- name: Upload to Hugging Face | |
env: | |
HUGGINGFACE_ACCESS_TOKEN: ${{ secrets.HUGGINGFACE_ACCESS_TOKEN }} | |
run: | | |
python -c ' | |
from huggingface_hub import upload_folder | |
import os | |
upload_folder( | |
folder_path=".", | |
path_in_repo="/", | |
repo_id="datenlabor-bmz/ai-language-monitor", | |
repo_type="space", | |
token=os.environ["HUGGINGFACE_ACCESS_TOKEN"], | |
commit_message="Upload from nightly evaluation run", | |
) | |
' |