From 91431f5bcaac2669d025bee7d653adcf02db9b5f Mon Sep 17 00:00:00 2001 From: axel7083 <42176370+axel7083@users.noreply.github.com> Date: Thu, 11 Apr 2024 18:14:28 +0200 Subject: [PATCH] chore: update run.sh script (#11) * chore: update run.sh script Signed-off-by: axel7083 <42176370+axel7083@users.noreply.github.com> * fix: removing config file related code Signed-off-by: axel7083 <42176370+axel7083@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Florent BENOIT Signed-off-by: axel7083 <42176370+axel7083@users.noreply.github.com> * Update chat/run.sh Signed-off-by: axel7083 <42176370+axel7083@users.noreply.github.com> --------- Signed-off-by: axel7083 <42176370+axel7083@users.noreply.github.com> Co-authored-by: Florent BENOIT --- chat/requirements.txt | 2 +- chat/run.sh | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) 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