Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow building mock image #5

Merged
merged 1 commit into from
Sep 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/build_push_image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
branches:
- build-push-llama3-image
- build-push-phi3-image
- build-push-mock-image
workflow_dispatch:

env:
Expand Down Expand Up @@ -39,6 +40,8 @@ jobs:
echo "MODEL_NAME=llama3" >> $GITHUB_ENV
elif [[ "${{ github.ref }}" == "refs/heads/build-push-phi3-image" ]]; then
echo "MODEL_NAME=phi3" >> $GITHUB_ENV
elif [[ "${{ github.ref }}" == "refs/heads/build-push-mock-image" ]]; then
echo "MODEL_NAME=mock" >> $GITHUB_ENV
fi

- name: Docker build and push
Expand Down
5 changes: 5 additions & 0 deletions src/compute_horde_prompt_gen/download_model.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import os
import argparse
import sys
from transformers import (
AutoTokenizer,
AutoModelForCausalLM,
Expand Down Expand Up @@ -39,6 +40,10 @@
)

args = parser.parse_args()

if args.model_name == "mock":
sys.exit(0)

save_path = os.path.join(args.save_path, args.model_name)
model_name = MODEL_PATHS[args.model_name]
print(f"Saving {model_name} model to {save_path}")
Expand Down
Loading