|
|
@ -12,32 +12,45 @@ jobs:
|
|
|
|
BLOOM_TESTING_WRITE_TOKEN: ${{ secrets.BLOOM_TESTING_WRITE_TOKEN }}
|
|
|
|
BLOOM_TESTING_WRITE_TOKEN: ${{ secrets.BLOOM_TESTING_WRITE_TOKEN }}
|
|
|
|
timeout-minutes: 15
|
|
|
|
timeout-minutes: 15
|
|
|
|
steps:
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Checkout
|
|
|
|
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: Check if the model is cached
|
|
|
|
|
|
|
|
id: cache-model
|
|
|
|
|
|
|
|
uses: actions/cache@v2
|
|
|
|
|
|
|
|
with:
|
|
|
|
|
|
|
|
path: ~/.dummy
|
|
|
|
|
|
|
|
key: model-v1-${{ hashFiles('setup.cfg', 'src/petals/cli/convert_model.py') }}
|
|
|
|
- name: Set up Python
|
|
|
|
- name: Set up Python
|
|
|
|
|
|
|
|
if: steps.cache-model.outputs.cache-hit != 'true'
|
|
|
|
uses: actions/setup-python@v2
|
|
|
|
uses: actions/setup-python@v2
|
|
|
|
with:
|
|
|
|
with:
|
|
|
|
python-version: 3.9
|
|
|
|
python-version: 3.9
|
|
|
|
- name: Cache dependencies
|
|
|
|
- name: Cache dependencies
|
|
|
|
|
|
|
|
if: steps.cache-model.outputs.cache-hit != 'true'
|
|
|
|
uses: actions/cache@v2
|
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
with:
|
|
|
|
path: ~/.cache/pip
|
|
|
|
path: ~/.cache/pip
|
|
|
|
key: Key-v1-3.9-${{ hashFiles('setup.cfg') }}
|
|
|
|
key: Key-v1-3.9-${{ hashFiles('setup.cfg') }}
|
|
|
|
- name: Install dependencies
|
|
|
|
- name: Install dependencies
|
|
|
|
|
|
|
|
if: steps.cache-model.outputs.cache-hit != 'true'
|
|
|
|
run: |
|
|
|
|
run: |
|
|
|
|
python -m pip install --upgrade pip
|
|
|
|
python -m pip install --upgrade pip
|
|
|
|
pip install .[dev]
|
|
|
|
pip install .
|
|
|
|
- name: Delete any test models older than 1 week
|
|
|
|
- name: Delete any test models older than 1 week
|
|
|
|
|
|
|
|
if: steps.cache-model.outputs.cache-hit != 'true'
|
|
|
|
run: |
|
|
|
|
run: |
|
|
|
|
python tests/scripts/remove_old_models.py --author bloom-testing --use_auth_token $BLOOM_TESTING_WRITE_TOKEN
|
|
|
|
python tests/scripts/remove_old_models.py --author bloom-testing --use_auth_token $BLOOM_TESTING_WRITE_TOKEN
|
|
|
|
- name: Delete previous version of this model, if exists
|
|
|
|
- name: Delete previous version of this model, if exists
|
|
|
|
|
|
|
|
if: steps.cache-model.outputs.cache-hit != 'true'
|
|
|
|
run: |
|
|
|
|
run: |
|
|
|
|
export HF_TAG=$(python -c "import os; print(os.environ.get('GITHUB_HEAD_REF') or os.environ.get('GITHUB_REF_NAME'))")
|
|
|
|
export HF_TAG=$(python -c "import os; print(os.environ.get('GITHUB_HEAD_REF') or os.environ.get('GITHUB_REF_NAME'))")
|
|
|
|
python -c "from huggingface_hub import delete_repo; delete_repo(token='$BLOOM_TESTING_WRITE_TOKEN', \
|
|
|
|
python -c "from huggingface_hub import delete_repo; delete_repo(token='$BLOOM_TESTING_WRITE_TOKEN', \
|
|
|
|
repo_id='bloom-testing/test-bloomd-560m-$HF_TAG')" || true
|
|
|
|
repo_id='bloom-testing/test-bloomd-560m-$HF_TAG')" || true
|
|
|
|
- name: Convert model and push to hub
|
|
|
|
- name: Convert model and push to hub
|
|
|
|
|
|
|
|
if: steps.cache-model.outputs.cache-hit != 'true'
|
|
|
|
run: |
|
|
|
|
run: |
|
|
|
|
export HF_TAG=$(python -c "import os; print(os.environ.get('GITHUB_HEAD_REF') or os.environ.get('GITHUB_REF_NAME'))")
|
|
|
|
export HF_TAG=${{ hashFiles('setup.cfg', 'src/petals/cli/convert_model.py') }}
|
|
|
|
python -m petals.cli.convert_model --model bigscience/bloom-560m --output_path ./converted_model \
|
|
|
|
python -m petals.cli.convert_model --model bigscience/bloom-560m --output_path ./converted_model \
|
|
|
|
--output_repo bloom-testing/test-bloomd-560m-$HF_TAG --use_auth_token $BLOOM_TESTING_WRITE_TOKEN \
|
|
|
|
--output_repo bloom-testing/test-bloomd-560m-$HF_TAG --use_auth_token $BLOOM_TESTING_WRITE_TOKEN \
|
|
|
|
--resize_token_embeddings 50000
|
|
|
|
--resize_token_embeddings 50000
|
|
|
|
|
|
|
|
|
|
|
@ -50,7 +63,8 @@ jobs:
|
|
|
|
fail-fast: false
|
|
|
|
fail-fast: false
|
|
|
|
timeout-minutes: 15
|
|
|
|
timeout-minutes: 15
|
|
|
|
steps:
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Checkout
|
|
|
|
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Set up Python
|
|
|
|
- name: Set up Python
|
|
|
|
uses: actions/setup-python@v2
|
|
|
|
uses: actions/setup-python@v2
|
|
|
|
with:
|
|
|
|
with:
|
|
|
@ -66,7 +80,7 @@ jobs:
|
|
|
|
pip install .[dev]
|
|
|
|
pip install .[dev]
|
|
|
|
- name: Test
|
|
|
|
- name: Test
|
|
|
|
run: |
|
|
|
|
run: |
|
|
|
|
export HF_TAG=$(python -c "import os; print(os.environ.get('GITHUB_HEAD_REF') or os.environ.get('GITHUB_REF_NAME'))")
|
|
|
|
export HF_TAG=${{ hashFiles('setup.cfg', 'src/petals/cli/convert_model.py') }}
|
|
|
|
export MODEL_NAME=bloom-testing/test-bloomd-560m-$HF_TAG
|
|
|
|
export MODEL_NAME=bloom-testing/test-bloomd-560m-$HF_TAG
|
|
|
|
export REF_NAME=bigscience/bloom-560m
|
|
|
|
export REF_NAME=bigscience/bloom-560m
|
|
|
|
|
|
|
|
|
|
|
|