From 57d178456a75d40476c3b46ecd9a9818a817791c Mon Sep 17 00:00:00 2001 From: Osman Karaketir Date: Sat, 27 Apr 2024 23:50:07 +0300 Subject: [PATCH] fix: docker gpus option "all" support "docker --gpus=all" is a valid and mostly used command. regex updated to match this. --- run-compose.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/run-compose.sh b/run-compose.sh index 08fba272b..21574e959 100755 --- a/run-compose.sh +++ b/run-compose.sh @@ -82,6 +82,7 @@ usage() { echo "Examples:" echo " $0 --drop" echo " $0 --enable-gpu[count=1]" + echo " $0 --enable-gpu[count=all]" echo " $0 --enable-api[port=11435]" echo " $0 --enable-gpu[count=1] --enable-api[port=12345] --webui[port=3000]" echo " $0 --enable-gpu[count=1] --enable-api[port=12345] --webui[port=3000] --data[folder=./ollama-data]" @@ -160,7 +161,7 @@ else if [[ $enable_gpu == true ]]; then # Validate and process command-line arguments if [[ -n $gpu_count ]]; then - if ! [[ $gpu_count =~ ^[0-9]+$ ]]; then + if ! [[ $gpu_count =~ ^([0-9]+|all)$ ]]; then echo "Invalid GPU count: $gpu_count" exit 1 fi