mirror of
https://github.com/open-compass/opencompass.git
synced 2025-05-30 16:03:24 +08:00
Add test runner, one case, daily and pr trigger (#751)
* init test yaml * add simple pr * update * update * change name * Update pr-run-test.yml * Update pr-run-test.yml --------- Co-authored-by: zhulin1 <zhulin1@pjlab.org.cn>
This commit is contained in:
parent
83d6c48378
commit
2cd091647c
61
.github/workflows/pr-run-test.yml
vendored
Normal file
61
.github/workflows/pr-run-test.yml
vendored
Normal file
@ -0,0 +1,61 @@
|
|||||||
|
name: pr_run_test
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
paths-ignore:
|
||||||
|
- 'README.md'
|
||||||
|
- 'README_zh-CN.md'
|
||||||
|
- 'docs/**'
|
||||||
|
- 'configs/**'
|
||||||
|
- 'tools/**'
|
||||||
|
|
||||||
|
workflow_dispatch:
|
||||||
|
schedule:
|
||||||
|
- cron: '56 0 * * *'
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
test_run:
|
||||||
|
runs-on: self-hosted
|
||||||
|
timeout-minutes: 20
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
python-version: ['3.10']
|
||||||
|
steps:
|
||||||
|
- name: Clone repository
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
- name: Prepare - Clone Conde Env install and copy data
|
||||||
|
run: |
|
||||||
|
eval "$(conda shell.bash hook)"
|
||||||
|
conda create --name opencompass_regression --clone opencompass_base
|
||||||
|
conda activate opencompass_regression
|
||||||
|
python3 -m pip install -e .
|
||||||
|
cp -r /cpfs01/user/qa-llm-cicd/data .
|
||||||
|
rm -rf ~/.cache/huggingface/hub -f && mkdir ~/.cache -p && mkdir ~/.cache/huggingface -p
|
||||||
|
ln -s /cpfs01/shared/public/public_hdd/llmeval/model_weights/hf_hub ~/.cache/huggingface/hub
|
||||||
|
conda info --envs
|
||||||
|
- name: Run test
|
||||||
|
run: |
|
||||||
|
eval "$(conda shell.bash hook)"
|
||||||
|
conda activate opencompass_regression
|
||||||
|
conda info --envs
|
||||||
|
rm -rf regression_result
|
||||||
|
python3 run.py --models hf_internlm_chat_7b --datasets siqa_gen --work-dir regression_result --debug
|
||||||
|
- name: Remove Conda Env
|
||||||
|
run: |
|
||||||
|
eval "$(conda shell.bash hook)"
|
||||||
|
conda env remove --name opencompass_regression
|
||||||
|
conda info --envs
|
||||||
|
- name: Get result
|
||||||
|
run: |
|
||||||
|
score=$(sed -n '$p' regression_result/*/summary/*.csv | awk -F ',' '{print $NF}')
|
||||||
|
if (( ${score%.*} >= 70 && ${score%.*} <= 80 )); then
|
||||||
|
echo "score is $score between 70 and 80"
|
||||||
|
else
|
||||||
|
echo "score is $score not between 70 and 80"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
rm -rf regression_result
|
Loading…
Reference in New Issue
Block a user