Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prepare containers to run with ai-lab-recipes #803

Merged
merged 1 commit into from
Feb 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions container-images/cuda/Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,6 @@ RUN dnf install -y python3 && \
# Copy the entire installation directory from the builder
COPY --from=builder /tmp/install /usr

ENV MODEL_PATH=/mnt/models/model.file

COPY --chmod=755 ../scripts /usr/bin
8 changes: 5 additions & 3 deletions container-images/ramalama/Containerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
FROM registry.access.redhat.com/ubi9/ubi:9.5-1739449058

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"
18 changes: 18 additions & 0 deletions container-images/scripts/llama-server.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash
if [ -n "${MODEL_CHAT_FORMAT}" ]; then
CHAT_FORMAT="--chat_template ${MODEL_CHAT_FORMAT}"
fi

if [ -n ${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

13 changes: 13 additions & 0 deletions container-images/scripts/whisper-run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash
if [ -n ${MODEL_PATH} ]; then
whisper-server \
-tr \
--model ${MODEL_PATH} \
--convert \
--host ${HOST:=0.0.0.0} \
--port ${PORT:=8001}
exit 0
fi

echo "Please set a MODEL_PATH"
exit 1
8 changes: 5 additions & 3 deletions container-images/vulkan/Containerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
FROM registry.access.redhat.com/ubi9/ubi:9.5-1739449058

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"

Loading