Skip to content
This repository was archived by the owner on Dec 11, 2024. It is now read-only.

Commit df55d37

Browse files
authored
Merge pull request #53 from mindvalley/chore/optimize-model-build-workflow
remove some models to save memory during build
2 parents 07c9125 + 9c2d2d4 commit df55d37

File tree

2 files changed

+10
-13
lines changed

2 files changed

+10
-13
lines changed

.github/workflows/gar-build-push-model-server-container-on-tag.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
id: metadata
4646
with:
4747
images: |
48-
us-docker.pkg.dev/${{ env.GarProjectID }}/${{ env.GarRepo }}/${{ env.GarImageName }}:${{ github.ref_name }}
48+
us-docker.pkg.dev/${{ env.GarProjectID }}/${{ env.GarRepo }}/${{ env.GarImageName }}:${{ github.sha }}
4949
5050
- name: Model Server Image Docker Build and Push
5151
uses: int128/kaniko-action@v1
@@ -60,7 +60,7 @@ jobs:
6060
--snapshot-mode=redo
6161
--cache-ttl=730h
6262
tags: |
63-
us-docker.pkg.dev/${{ env.GarProjectID }}/${{ env.GarRepo }}/${{ env.GarImageName }}:${{ github.ref_name }}
63+
us-docker.pkg.dev/${{ env.GarProjectID }}/${{ env.GarRepo }}/${{ env.GarImageName }}:${{ github.sha }}
6464
us-docker.pkg.dev/${{ env.GarProjectID }}/${{ env.GarRepo }}/${{ env.GarImageName }}:latest
6565
build-args: |
66-
DANSWER_VERSION=${{ github.ref_name }}
66+
DANSWER_VERSION=${{ github.sha }}

backend/Dockerfile.model_server

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,16 @@ RUN apt-get remove -y --allow-remove-essential perl-base && \
2121
# Download tokenizers, distilbert for the Danswer model
2222
# Download model weights
2323
# Run Nomic to pull in the custom architecture and have it cached locally
24-
RUN python -c "from transformers import AutoTokenizer; \
25-
AutoTokenizer.from_pretrained('distilbert-base-uncased'); \
26-
AutoTokenizer.from_pretrained('mixedbread-ai/mxbai-rerank-xsmall-v1'); \
27-
from huggingface_hub import snapshot_download; \
28-
snapshot_download(repo_id='danswer/hybrid-intent-token-classifier', revision='v1.0.3'); \
29-
snapshot_download('nomic-ai/nomic-embed-text-v1'); \
30-
snapshot_download('mixedbread-ai/mxbai-rerank-xsmall-v1'); \
31-
from sentence_transformers import SentenceTransformer; \
32-
SentenceTransformer(model_name_or_path='nomic-ai/nomic-embed-text-v1', trust_remote_code=True);"
24+
# RUN python -c "from transformers import AutoTokenizer; \
25+
# from huggingface_hub import snapshot_download; \
26+
# snapshot_download(repo_id='danswer/hybrid-intent-token-classifier', revision='v1.0.3'); \
27+
# snapshot_download('nomic-ai/nomic-embed-text-v1'); \
28+
# from sentence_transformers import SentenceTransformer; \
29+
# SentenceTransformer(model_name_or_path='nomic-ai/nomic-embed-text-v1', trust_remote_code=True);"
3330

3431
# In case the user has volumes mounted to /root/.cache/huggingface that they've downloaded while
3532
# running Danswer, don't overwrite it with the built in cache folder
36-
RUN mv /root/.cache/huggingface /root/.cache/temp_huggingface
33+
# RUN mv /root/.cache/huggingface /root/.cache/temp_huggingface
3734

3835
WORKDIR /app
3936

0 commit comments

Comments
 (0)