Skip to content

Commit

Permalink
better build push
Browse files Browse the repository at this point in the history
  • Loading branch information
andreea-popescu-reef committed Sep 17, 2024
1 parent 55607cd commit 69f258c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
21 changes: 16 additions & 5 deletions .github/workflows/build_push_image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ name: "CD: build & push image"

on:
push:
branches: [build-image]
branches:
- build-push-llama3-image
- build-push-phi3-image
workflow_dispatch:

env:
Expand All @@ -12,7 +14,7 @@ env:

jobs:
deploy:
timeout-minutes: 15
timeout-minutes: 30
runs-on:
group: bulkier
steps:
Expand All @@ -31,13 +33,22 @@ jobs:
run: |
python -m pip install transformers torch
- name: Set environment variables based on branch
run: |
if [[ "${{ github.ref }}" == "refs/heads/build-push-llama3-image" ]]; then
echo "MODEL_NAME=llama3" >> $GITHUB_ENV
elif [[ "${{ github.ref }}" == "refs/heads/build-push-phi3-image" ]]; then
echo "MODEL_NAME=phi3" >> $GITHUB_ENV
fi
- name: Docker build and push
run: |
df -h
IMAGE_NAME="${DOCKER_REPO_NAME}:${TAG_VERSION}"
IMAGE_NAME="${DOCKER_REPO_NAME}-{MODEL_NAME}:${TAG_VERSION}"
cd src/compute_horde_prompt_gen
python download_model.py --model_name phi3 --huggingface_token "${{ secrets.HUGGINGFACE_API_KEY }}"
python download_model.py --model_name ${{ env.MODEL_NAME }} --huggingface_token "${{ secrets.HUGGINGFACE_API_KEY }}"
docker build -t $IMAGE_NAME .
docker push $IMAGE_NAME
1 change: 1 addition & 0 deletions src/compute_horde_prompt_gen/download_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
model_name = MODEL_PATHS[args.model_name]
print(f"Saving {model_name} model to {save_path}")

quantization_config = None
if args.quantize:
import torch
from transformers import BitsAndBytesConfig
Expand Down

0 comments on commit 69f258c

Please sign in to comment.