From 7768d4de546bbde0f4894bc2ee12dbe15f730e25 Mon Sep 17 00:00:00 2001 From: Daniel J Walsh Date: Fri, 12 Apr 2024 09:12:16 -0400 Subject: [PATCH] Improve model_server Makefile. Also improve description of models Containerfile. Signed-off-by: Daniel J Walsh --- models/Containerfile | 14 ++++++++++---- models/Makefile | 4 ++-- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/models/Containerfile b/models/Containerfile index fefecb5b..a49d39c0 100644 --- a/models/Containerfile +++ b/models/Containerfile @@ -1,9 +1,15 @@ -#https://huggingface.co/TheBloke/Llama-2-7B-Chat-GGUF/resolve/main/llama-2-7b-chat.Q5_K_S.gguf -#https://huggingface.co/TheBloke/Mistral-7B-Instruct-v0.1-GGUF/resolve/main/mistral-7b-instruct-v0.1.Q4_K_M.gguf -#https://huggingface.co/TheBloke/CodeLlama-7B-Instruct-GGUF/resolve/main/codellama-7b-instruct.Q4_K_M.gguf -#https://huggingface.co/ggerganov/whisper.cpp/resolve/main/ggml-small.bin +# Suggested alternative open AI Models +# https://huggingface.co/TheBloke/Llama-2-7B-Chat-GGUF/resolve/main/llama-2-7b-chat.Q5_K_S.gguf +# https://huggingface.co/TheBloke/Mistral-7B-Instruct-v0.1-GGUF/resolve/main/mistral-7b-instruct-v0.1.Q4_K_M.gguf (Default) +# https://huggingface.co/TheBloke/CodeLlama-7B-Instruct-GGUF/resolve/main/codellama-7b-instruct.Q4_K_M.gguf +# https://huggingface.co/ggerganov/whisper.cpp/resolve/main/ggml-small.bin # podman build --build-arg MODEL_URL=https://... -t quay.io/yourimage . +# FROM registry.access.redhat.com/ubi9/ubi-micro:9.3-13 + +# Can be substituted using the --build-arg defined above ARG MODEL_URL=https://huggingface.co/TheBloke/Mistral-7B-Instruct-v0.1-GGUF/resolve/main/mistral-7b-instruct-v0.1.Q4_K_M.gguf + +# By default the Model Server container image uses the AI Model stored in the model/model.file file. WORKDIR /model ADD $MODEL_URL /model/model.file diff --git a/models/Makefile b/models/Makefile index 0953b54a..d3f46a72 100644 --- a/models/Makefile +++ b/models/Makefile @@ -1,6 +1,6 @@ -MODEL ?= MODEL=https://huggingface.co/TheBloke/Mistral-7B-Instruct-v0.1-GGUF/resolve/main/mistral-7b-instruct-v0.1.Q4_K_M.gguf +MODEL ?= https://huggingface.co/TheBloke/Mistral-7B-Instruct-v0.1-GGUF/resolve/main/mistral-7b-instruct-v0.1.Q4_K_M.gguf IMAGE ?= quay.io/ai-lab/llama:latest .PHONY: build build: - podman build --build-arg ${MODEL} -f Containerfile -t ${IMAGE} . + podman build $${MODEL:+--build-arg MODEL=$${MODEL}} -f Containerfile -t ${IMAGE} .