diff --git a/Dockerfile-Modal b/Dockerfile-Modal index aaf9699..56f5e19 100644 --- a/Dockerfile-Modal +++ b/Dockerfile-Modal @@ -1,7 +1,8 @@ FROM debian:bullseye-slim AS build-image -#ARG MODEL -#ENV MODEL=${MODEL} +ARG MODEL +ARG HOME +ENV MODEL=${MODEL} COPY ${HOME}/download.sh ./ # Install build dependencies @@ -15,7 +16,7 @@ RUN chmod +x *.sh && \ # Grab a fresh copy of the Python image FROM python:3.11-slim -#ARG MODEL +ARG MODEL RUN mkdir -p ${MODEL} COPY --from=build-image ${MODEL} ${MODEL} diff --git a/open/text/embeddings/server/modal.py b/open/text/embeddings/server/modal.py index aeeed1f..5f3c7dd 100644 --- a/open/text/embeddings/server/modal.py +++ b/open/text/embeddings/server/modal.py @@ -5,12 +5,16 @@ app = App(os.environ["APP_NAME"]) image = Image.from_dockerfile( - "Dockerfile-Modal", force_build=True + "Dockerfile-Modal", + force_build=True, + build_args={ + "MODEL": os.environ["MODEL"], + "HOME": os.environ["HOME"], + } ).env({ "MODEL": os.environ["MODEL"], "NORMALIZE_EMBEDDINGS": os.environ["NORMALIZE_EMBEDDINGS"], "VERBOSE": os.environ["VERBOSE"], - "HOME": os.environ["HOME"], "HF_HOME": "/tmp/hf_home", })