Skip to content

Commit cf9f4bc

Browse files
committed
Append to args variable
Keeping Gemini happy Signed-off-by: Eric Curtin <[email protected]>
1 parent 36bc604 commit cf9f4bc

File tree

1 file changed

+9
-14
lines changed

1 file changed

+9
-14
lines changed

scripts/docker-run.sh

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,22 @@
33
main() {
44
set -eux -o pipefail
55

6-
local gpu_device_flag=()
6+
local args=(docker run --rm -p "$PORT:$PORT" -v "$MODELS_PATH:/models"
7+
-e MODEL_RUNNER_PORT="$PORT" -e LLAMA_SERVER_PATH=/app/bin
8+
-e MODELS_PATH=/models -e LLAMA_ARGS="$LLAMA_ARGS"
9+
-e DMR_ORIGINS="$DMR_ORIGINS" -e DO_NOT_TRACK="$DO_NOT_TRACK"
10+
-e DEBUG="$DEBUG"
11+
)
12+
713
for i in /dev/dri /dev/kfd /dev/accel /dev/davinci* /dev/devmm_svm /dev/hisi_hdc; do
814
if [ -e "$i" ]; then
9-
gpu_device_flag+=("--device" "$i")
15+
args+=("--device" "$i")
1016
fi
1117
done
1218

1319
mkdir -p "$MODELS_PATH"
1420
chmod a+rx "$MODELS_PATH"
15-
docker run --rm \
16-
-p "$PORT:$PORT" \
17-
-v "$MODELS_PATH:/models" \
18-
-e MODEL_RUNNER_PORT="$PORT" \
19-
-e LLAMA_SERVER_PATH=/app/bin \
20-
-e MODELS_PATH=/models \
21-
-e LLAMA_ARGS="$LLAMA_ARGS" \
22-
-e DMR_ORIGINS="$DMR_ORIGINS" \
23-
-e DO_NOT_TRACK="$DO_NOT_TRACK" \
24-
-e DEBUG="$DEBUG" \
25-
"${gpu_device_flag[@]+"${gpu_device_flag[@]}"}" \
26-
"$DOCKER_IMAGE"
21+
"${args[@]}" "$DOCKER_IMAGE"
2722
}
2823

2924
main "$@"

0 commit comments

Comments
 (0)