diff --git a/chat/requirements.txt b/chat/requirements.txt index bbea3dd..66f8c7b 100644 --- a/chat/requirements.txt +++ b/chat/requirements.txt @@ -1 +1 @@ -llama-cpp-python[server] \ No newline at end of file +llama-cpp-python[server]==0.2.57 diff --git a/chat/run.sh b/chat/run.sh index 756a9e9..699a010 100755 --- a/chat/run.sh +++ b/chat/run.sh @@ -15,4 +15,10 @@ # limitations under the License. # # SPDX-License-Identifier: Apache-2.0 -python -m llama_cpp.server --model ${MODEL_PATH} --host ${HOST:=0.0.0.0} --port ${PORT:=8000} --n_gpu_layers 0 +if [ ${MODEL_PATH} ]; then + python -m llama_cpp.server --model ${MODEL_PATH} --host ${HOST:=0.0.0.0} --port ${PORT:=8001} --n_gpu_layers ${GPU_LAYERS:=0} --clip_model_path ${CLIP_MODEL_PATH:=None} --chat_format ${MODEL_CHAT_FORMAT:="llama-2"} + exit 0 +fi + +echo "This image should not be used outside of Podman Desktop AI Lab extension. Missing required MODEL_PATH environment variable." +exit 1