-
Notifications
You must be signed in to change notification settings - Fork 116
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prepare containers to run with ai-lab-recipes
Add two new scripts llama-server.sh and whisper-server.sh which can handle environment variables from the ai-lab-recipes. Signed-off-by: Daniel J Walsh <[email protected]>
- Loading branch information
Showing
5 changed files
with
39 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
FROM registry.access.redhat.com/ubi9/ubi:9.5-1738814488 | ||
|
||
COPY ../scripts /scripts | ||
RUN chmod +x /scripts/*.sh && \ | ||
/scripts/build_llama_and_whisper.sh "ramalama" | ||
ENV MODEL_PATH=/mnt/models/model.file | ||
|
||
COPY --chmod=755 ../scripts /usr/bin | ||
|
||
RUN /usr/bin/build_llama_and_whisper.sh "ramalama" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/bash | ||
if [ "${MODEL_CHAT_FORMAT}" != "" ]; then | ||
CHAT_FORMAT="--chat_template ${MODEL_CHAT_FORMAT}" | ||
fi | ||
|
||
if [ ${MODEL_PATH} ]; then | ||
llama-server \ | ||
--model ${MODEL_PATH} \ | ||
--host ${HOST:=0.0.0.0} \ | ||
--port ${PORT:=8001} \ | ||
--gpu_layers ${GPU_LAYERS:=0} \ | ||
${CHAT_FORMAT} | ||
exit 0 | ||
fi | ||
|
||
echo "Please set a MODEL_PATH" | ||
exit 1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/bash | ||
|
||
whisper-server \ | ||
-tr \ | ||
--model ${MODEL_PATH} \ | ||
--convert \ | ||
--host ${HOST:=0.0.0.0} \ | ||
--port ${PORT:=8001} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
FROM registry.access.redhat.com/ubi9/ubi:9.5-1738814488 | ||
|
||
COPY ../scripts /scripts | ||
RUN chmod +x /scripts/*.sh && \ | ||
/scripts/build_llama_and_whisper.sh "vulkan" | ||
ENV MODEL_PATH=/mnt/models/model.file | ||
|
||
COPY --chmod=755 ../scripts /usr/bin | ||
|
||
RUN /usr/bin/build_llama_and_whisper.sh "ramalama" | ||
|