kamp0010 commited on
Commit
40f5b34
·
verified ·
1 Parent(s): 3d12711

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +3 -9
Dockerfile CHANGED
@@ -16,17 +16,11 @@ COPY main.py .
16
  RUN useradd -m -u 1000 user
17
 
18
  # Pre-download model into the image cache so cold starts are fast.
19
- # The || true ensures a network failure during build doesn't break the image
20
- # the model will simply be downloaded on first startup instead.
21
  RUN python -c "\
22
- import builtins; builtins.input = lambda p='': 'y'; \
23
  import os; os.environ['HF_HUB_VERBOSITY'] = 'error'; \
24
- from transformers import AutoModel; \
25
- model = AutoModel.from_pretrained( \
26
- 'jinaai/jina-embeddings-v2-base-code', \
27
- trust_remote_code=True, \
28
- low_cpu_mem_usage=True, \
29
- ); \
30
  print('Model cached.')" || echo "Model pre-cache skipped — will download at runtime."
31
 
32
  USER user
 
16
  RUN useradd -m -u 1000 user
17
 
18
  # Pre-download model into the image cache so cold starts are fast.
19
+ # The || true ensures a network failure during build doesn't break the image.
 
20
  RUN python -c "\
 
21
  import os; os.environ['HF_HUB_VERBOSITY'] = 'error'; \
22
+ from sentence_transformers import SentenceTransformer; \
23
+ SentenceTransformer('jinaai/jina-embeddings-v2-base-code', trust_remote_code=True); \
 
 
 
 
24
  print('Model cached.')" || echo "Model pre-cache skipped — will download at runtime."
25
 
26
  USER user