mirror of https://github.com/InternLM/InternLM
[CI] add transformers version converage (#674)
parent
3599ddd0e4
commit
8194c348c1
|
@ -11,6 +11,9 @@ env:
|
||||||
jobs:
|
jobs:
|
||||||
HF_model:
|
HF_model:
|
||||||
runs-on: [t_cluster]
|
runs-on: [t_cluster]
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
transformers-version: [4.34.0, latest]
|
||||||
steps:
|
steps:
|
||||||
- name: mask env
|
- name: mask env
|
||||||
run: |
|
run: |
|
||||||
|
@ -19,33 +22,32 @@ jobs:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: load_hf_model
|
- name: load_hf_model
|
||||||
|
if: matrix.transformers-version != 'latest'
|
||||||
|
run: |
|
||||||
|
conda create -n internlm-model-latest --clone ${CONDA_BASE_ENV}
|
||||||
|
source activate internlm-model-latest
|
||||||
|
pip install transformers==${{ matrix.transformers-version }}
|
||||||
|
pip install sentencepiece
|
||||||
|
srun -p ${SLURM_PARTITION} --kill-on-bad-exit=1 --job-name=${GITHUB_RUN_ID}-${GITHUB_JOB} --gpus-per-task=2 pytest -s -v --color=yes ./tests/test_hf_model.py
|
||||||
|
conda deactivate
|
||||||
|
- name: load_latest_hf_model
|
||||||
|
if: matrix.transformers-version == 'latest'
|
||||||
run: |
|
run: |
|
||||||
conda create -n internlm-model-latest --clone ${CONDA_BASE_ENV}
|
conda create -n internlm-model-latest --clone ${CONDA_BASE_ENV}
|
||||||
source activate internlm-model-latest
|
source activate internlm-model-latest
|
||||||
# TODO:test other version of transformers
|
|
||||||
pip install transformers
|
pip install transformers
|
||||||
pip install sentencepiece
|
pip install sentencepiece
|
||||||
srun -p ${SLURM_PARTITION} --kill-on-bad-exit=1 --job-name=${GITHUB_RUN_ID}-${GITHUB_JOB} --gpus-per-task=2 pytest -s -v --color=yes ./tests/test_hf_model.py
|
srun -p ${SLURM_PARTITION} --kill-on-bad-exit=1 --job-name=${GITHUB_RUN_ID}-${GITHUB_JOB} --gpus-per-task=2 pytest -s -v --color=yes ./tests/test_hf_model.py
|
||||||
conda deactivate
|
conda deactivate
|
||||||
|
|
||||||
clear_env:
|
|
||||||
if: ${{ !cancelled() }}
|
|
||||||
needs: [HF_model]
|
|
||||||
runs-on: [t_cluster]
|
|
||||||
timeout-minutes: 10
|
|
||||||
steps:
|
|
||||||
- name: mask env
|
|
||||||
run: |
|
|
||||||
echo "::add-mask::${{env.WORKSPACE_PREFIX}}"
|
|
||||||
echo "::add-mask::$path_prefix"
|
|
||||||
|
|
||||||
- name: remove_env
|
- name: remove_env
|
||||||
|
if: always()
|
||||||
run: |
|
run: |
|
||||||
conda env remove --name internlm-model-latest
|
conda env remove --name internlm-model-latest
|
||||||
|
|
||||||
|
|
||||||
notify_to_feishu:
|
notify_to_feishu:
|
||||||
if: ${{ always() && !cancelled() && contains(needs.*.result, 'failure') && (github.ref_name == 'develop' || github.ref_name == 'main') }}
|
if: ${{ always() && !cancelled() && contains(needs.*.result, 'failure') && (github.ref_name == 'develop' || github.ref_name == 'main') }}
|
||||||
needs: [HF_model,clear_env]
|
needs: [HF_model]
|
||||||
runs-on: [t_cluster]
|
runs-on: [t_cluster]
|
||||||
steps:
|
steps:
|
||||||
- name: mask env
|
- name: mask env
|
||||||
|
|
Loading…
Reference in New Issue