diff --git a/training/model/Containerfile b/training/model/Containerfile index c552b484..4ace3e17 100644 --- a/training/model/Containerfile +++ b/training/model/Containerfile @@ -1,5 +1,5 @@ FROM registry.access.redhat.com/ubi9/ubi RUN dnf install -y python3-pip && python3 -m pip install huggingface_hub[cli] -COPY entrypoint.sh /download +COPY entrypoint.sh /entrypoint.sh WORKDIR /download -ENTRYPOINT ["bash" "/download/entrypoint.sh"] \ No newline at end of file +ENTRYPOINT ["bash", "/entrypoint.sh"] diff --git a/training/model/Makefile b/training/model/Makefile index bd7db81a..3ce644bb 100644 --- a/training/model/Makefile +++ b/training/model/Makefile @@ -43,8 +43,9 @@ generate-model-cfile: download -v $(COMMON_PATH):/work:z \ -v ${OUTDIR}:/run/.input:ro \ --pull=never \ + --entrypoint python3 \ $(REGISTRY)/$(REGISTRY_ORG)/model-downloader:latest \ - python3 /work/generate-model-cfile.py /run/.input/models >> ${MODELS_CONTAINERFILE} + /work/generate-model-cfile.py /run/.input/models >> ${MODELS_CONTAINERFILE} .PHONY: bootc-models bootc-models: generate-model-cfile diff --git a/training/model/entrypoint.sh b/training/model/entrypoint.sh index 8cf291e9..fe854148 100755 --- a/training/model/entrypoint.sh +++ b/training/model/entrypoint.sh @@ -1,6 +1,7 @@ +set -x if [ -z "$HF_TOKEN" ]; then echo "Error. Please set your \$HF_TOKEN in env. Required to pull mixtral." exit 1 fi -huggingface-cli download --exclude "*.pt" --local-dir "/download/$(MODEL_REPO)" "$(MODEL_REPO)" +huggingface-cli download --exclude "*.pt" --local-dir "/download/${MODEL_REPO}" "${MODEL_REPO}"