mg643 commited on
Commit
e3d1f60
·
1 Parent(s): 9a66dc3

Fix Dockerfile - use script to download model

Browse files
Files changed (2) hide show
  1. Dockerfile +2 -11
  2. download_model.py +11 -0
Dockerfile CHANGED
@@ -6,19 +6,10 @@ COPY src/ src/
6
  COPY pyproject.toml .
7
  COPY uv.lock .
8
  COPY README.md .
 
9
 
10
  RUN pip install uv && uv sync --frozen
11
-
12
- RUN pip install huggingface_hub && \
13
- python -c "
14
- from huggingface_hub import hf_hub_download
15
- hf_hub_download(
16
- repo_id='mg643/brewmatch_classical',
17
- repo_type='model',
18
- filename='classical.pkl',
19
- local_dir='/app/models/checkpoints'
20
- )
21
- "
22
 
23
  EXPOSE 7860
24
  ENV FLASK_HOST=0.0.0.0
 
6
  COPY pyproject.toml .
7
  COPY uv.lock .
8
  COPY README.md .
9
+ COPY download_model.py .
10
 
11
  RUN pip install uv && uv sync --frozen
12
+ RUN pip install huggingface_hub && python download_model.py
 
 
 
 
 
 
 
 
 
 
13
 
14
  EXPOSE 7860
15
  ENV FLASK_HOST=0.0.0.0
download_model.py ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from huggingface_hub import hf_hub_download
2
+ import os
3
+
4
+ os.makedirs("/app/models/checkpoints", exist_ok=True)
5
+
6
+ hf_hub_download(
7
+ repo_id="mg643/brewmatch-classical",
8
+ repo_type="model",
9
+ filename="classical.pkl",
10
+ local_dir="/app/models/checkpoints"
11
+ )