Skip to content

Commit

Permalink
Use ugly Python hack for smaller download
Browse files Browse the repository at this point in the history
Signed-off-by: Costin Gamenț <[email protected]>
  • Loading branch information
kwozyman committed Apr 30, 2024
1 parent 04a7d08 commit c3197ce
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions training/model/Containerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
FROM quay.io/centos-bootc/centos-bootc:stream9

ARG MODEL_REPO=https://huggingface.co/ibm/granite-7b-base
ARG MODEL_PATH=/usr/share/ai-model
ARG MODEL_REPO=''
ARG MODEL_PATH=''

RUN dnf install -y git-lfs
RUN mkdir -p "${MODEL_PATH}"
RUN git clone --progress --verbose "${MODEL_REPO}" "${MODEL_PATH}"
RUN dnf install -y python3-pip && python -m pip install huggingface_hub
RUN mkdir -p "${MODEL_PATH}" \
&& echo from huggingface_hub import snapshot_download\;snapshot_download\(repo_id=\'${MODEL_REPO}\', local_dir=\'${MODEL_PATH}\', local_dir_use_symlinks=False\) | python
4 changes: 2 additions & 2 deletions training/model/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ IMAGE_TAG ?= latest
CONTAINER_TOOL ?= podman
CONTAINER_TOOL_EXTRA_ARGS ?=

MODEL_REPO ?=
MODEL_PATH ?=
MODEL_REPO ?= ibm/granite-7b-base
MODEL_PATH ?= /usr/share/ai-model

.PHONY: image
image:
Expand Down

0 comments on commit c3197ce

Please sign in to comment.