From 177d81bea6dd38188e7c66cf6bad27ae6319880a Mon Sep 17 00:00:00 2001 From: justheuristic Date: Sat, 16 Jul 2022 11:43:24 +0300 Subject: [PATCH] CI: use GIT_REF_NAME instead of GIT_HEAD_REF (#28) use GIT_REF_NAME instead of GIT_HEAD_REF --- .github/workflows/run-tests.yaml | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/.github/workflows/run-tests.yaml b/.github/workflows/run-tests.yaml index 41e5ebb..0478e08 100644 --- a/.github/workflows/run-tests.yaml +++ b/.github/workflows/run-tests.yaml @@ -28,17 +28,14 @@ jobs: pip install -r requirements.txt - name: Delete previous model, if exists run: | - echo $(env) - if [ -z "$GITHUB_HEAD_REF" ] - then - export GITHUB_HEAD_REF="main" - fi + export HF_TAG=$(python -c "import os; print(os.environ.get('GITHUB_BASE_REF') or os.environ.get('GITHUB_REF_NAME'))") python -c "from huggingface_hub import delete_repo; delete_repo(token='$BLOOM_TESTING_WRITE_TOKEN', \ - name='test-bloomd-350m-$GITHUB_HEAD_REF', organization='bloom-testing')" || true + name='test-bloomd-350m-$HF_TAG', organization='bloom-testing')" || true - name: Convert model and push to hub run: | + export HF_TAG=$(python -c "import os; print(os.environ.get('GITHUB_BASE_REF') or os.environ.get('GITHUB_REF_NAME'))") python -m cli.convert_model --model bigscience/bloom-350m --output_path ./converted_model \ - --output_repo bloom-testing/test-bloomd-350m-$GITHUB_HEAD_REF --use_auth_token $BLOOM_TESTING_WRITE_TOKEN + --output_repo bloom-testing/test-bloomd-350m-$HF_TAG --use_auth_token $BLOOM_TESTING_WRITE_TOKEN run-tests: @@ -67,11 +64,8 @@ jobs: pip install -r requirements-dev.txt - name: Test run: | - if [ -z "$GITHUB_HEAD_REF" ] - then - export GITHUB_HEAD_REF="main" - fi - export MODEL_NAME=bloom-testing/test-bloomd-350m-$GITHUB_HEAD_REF + export HF_TAG=$(python -c "import os; print(os.environ.get('GITHUB_BASE_REF') or os.environ.get('GITHUB_REF_NAME'))") + export MODEL_NAME=bloom-testing/test-bloomd-350m-$HF_TAG python -m cli.run_server --converted_model_name_or_path $MODEL_NAME --block_indices 0:12 \ --torch_dtype float32 --identity tests/test.id --host_maddrs /ip4/127.0.0.1/tcp/31337 --throughput 1 & SERVER1_PID=$!