Skip to content

Commit 7bd1c0b

Browse files
committed
drop the _VARS files, import from env (build arg based)
1 parent 6701d96 commit 7bd1c0b

5 files changed

Lines changed: 4 additions & 21 deletions

File tree

APP_VARS.py

Lines changed: 0 additions & 5 deletions
This file was deleted.

DOWNLOAD_VARS.py

Lines changed: 0 additions & 8 deletions
This file was deleted.

Dockerfile

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,6 @@ ADD convert-to-diffusers.py .
5050
RUN python3 convert-to-diffusers.py
5151
# RUN rm -rf checkpoints
5252

53-
# Which model to download and use; fork / downstream specific.
54-
ADD DOWNLOAD_VARS.py .
55-
5653
# Add your model weight files
5754
# (in this case we have a python script)
5855
ADD loadModel.py .
@@ -63,7 +60,4 @@ RUN python3 download.py
6360
ADD send.py .
6461
ADD app.py .
6562

66-
# Runtime vars (for init and inference); fork / downstream specific.
67-
ADD APP_VARS.py .
68-
6963
CMD python3 -u server.py

app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
from send import send
1818
import os
1919

20-
from APP_VARS import MODEL_ID
20+
MODEL_ID = os.environ.get("MODEL_ID")
2121

2222
PIPELINES = [
2323
"StableDiffusionPipeline",

download.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
# In this file, we define download_model
22
# It runs during container build time to get model weights built into the container
33

4-
from DOWNLOAD_VARS import MODEL_ID
4+
import os
55
from loadModel import loadModel, MODEL_IDS
66

7+
MODEL_ID = os.environ.get("MODEL_ID")
8+
79

810
def download_model():
911
# do a dry run of loading the huggingface model, which will download weights at build time

0 commit comments

Comments
 (0)