BICORP commited on
Commit
1bd8213
·
verified ·
1 Parent(s): 4ff8251

Upload 3 files

Browse files
Files changed (2) hide show
  1. Dockerfile +12 -3
  2. entrypoint.sh +10 -4
Dockerfile CHANGED
@@ -2,8 +2,18 @@ FROM ghcr.io/huggingface/chat-ui:latest AS base
2
 
3
  FROM ghcr.io/huggingface/text-generation-inference:latest AS final
4
 
5
- ARG MODEL_NAME
6
- ENV MODEL_NAME=${MODEL_NAME}
 
 
 
 
 
 
 
 
 
 
7
 
8
  ENV TZ=Europe/Paris \
9
  PORT=3000
@@ -43,7 +53,6 @@ ENV HOME=/home/user \
43
  RUN npm config set prefix /home/user/.local
44
  RUN npm install -g dotenv-cli
45
 
46
-
47
  # copy chat-ui from base image
48
  COPY --from=base --chown=1000 /app/node_modules /app/node_modules
49
  COPY --from=base --chown=1000 /app/package.json /app/package.json
 
2
 
3
  FROM ghcr.io/huggingface/text-generation-inference:latest AS final
4
 
5
+ # Define arguments for multiple models
6
+ ARG MODEL_NAME_1
7
+ ENV MODEL_NAME_1=${BronioInt/Lake-1}
8
+
9
+ ARG MODEL_NAME_2
10
+ ENV MODEL_NAME_2=${BronioInt/Lake-1_Plus}
11
+
12
+ ARG MODEL_NAME_3
13
+ ENV MODEL_NAME_3=${BronioInt/Lake-2_Flash}
14
+
15
+ ARG MODEL_NAME_3
16
+ ENV MODEL_NAME_3=${BronioInt/Lake-1_Pro}
17
 
18
  ENV TZ=Europe/Paris \
19
  PORT=3000
 
53
  RUN npm config set prefix /home/user/.local
54
  RUN npm install -g dotenv-cli
55
 
 
56
  # copy chat-ui from base image
57
  COPY --from=base --chown=1000 /app/node_modules /app/node_modules
58
  COPY --from=base --chown=1000 /app/package.json /app/package.json
entrypoint.sh CHANGED
@@ -2,19 +2,25 @@
2
 
3
  # Make sure `/data/db` directory exists even with persistent storage
4
  mkdir -p /data/db
 
5
  # If app crashed, mongo didn't stop gracefully. Remove all the old *.lock files
6
- find /data/db -name "*.lock" -type f -exec rm -f {} \;
 
7
  # Start the local Mongo database
8
  mongod &
9
 
10
- # Start the text-generation-inference process
11
- text-generation-launcher --model-id ${MODEL_NAME} --num-shard 1 --port 8080 --trust-remote-code &
 
 
 
12
 
13
- # Wait for text-generation-inference to start
14
  curl --retry 60 --retry-delay 10 --retry-connrefused http://127.0.0.1:8080/health
15
 
16
  # Start the chat-ui process
17
  dotenv -e /app/.env -c -- node /app/build/index.js -- --host 0.0.0.0 --port 3000
 
18
  # Wait for any process to exit
19
  wait -n
20
 
 
2
 
3
  # Make sure `/data/db` directory exists even with persistent storage
4
  mkdir -p /data/db
5
+
6
  # If app crashed, mongo didn't stop gracefully. Remove all the old *.lock files
7
+ find /data/db -name "*.lock" -type f -exec rm -f {} \;
8
+
9
  # Start the local Mongo database
10
  mongod &
11
 
12
+ # Start the text-generation-inference process for each model
13
+ for model in "$MODEL_NAME_1" "$MODEL_NAME_2" "$MODEL_NAME_3" "$MODEL_NAME_4" "$MODEL_NAME_5"; do
14
+ echo "Starting text-generation-inference for model: $model"
15
+ text-generation-launcher --model-id "$model" --num-shard 1 --port 8080 --trust-remote-code &
16
+ done
17
 
18
+ # Wait for the text-generation-inference processes to start
19
  curl --retry 60 --retry-delay 10 --retry-connrefused http://127.0.0.1:8080/health
20
 
21
  # Start the chat-ui process
22
  dotenv -e /app/.env -c -- node /app/build/index.js -- --host 0.0.0.0 --port 3000
23
+
24
  # Wait for any process to exit
25
  wait -n
26