From 0c0c5955c61ae64422374a53bd72a6e36f714dad Mon Sep 17 00:00:00 2001 From: Tanvir Date: Tue, 9 Jan 2024 13:27:39 +0600 Subject: [PATCH] feat(docker): add option to run ollama w/o GPU support --- run-ollama-docker.sh | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/run-ollama-docker.sh b/run-ollama-docker.sh index 914975f41..20770a2d0 100644 --- a/run-ollama-docker.sh +++ b/run-ollama-docker.sh @@ -1,9 +1,14 @@ #!/bin/bash +read -r -p "Do you want ollama in docker with GPU support? (y/n): " use_gpu + docker rm -f ollama || true docker pull ollama/ollama -# CPU Only -docker run -d -v ollama:/root/.ollama -p 11434:11434 --name ollama ollama/ollama -# GPU Support -# docker run -d --gpus=all -v ollama:/root/.ollama -p 11434:11434 --name ollama ollama/ollama -docker image prune -f \ No newline at end of file + +if [ "$use_gpu" == "y" ]; then + docker run -d --gpus=all -v ollama:/root/.ollama -p 11434:11434 --name ollama ollama/ollama +else + docker run -d -v ollama:/root/.ollama -p 11434:11434 --name ollama ollama/ollama +fi + +docker image prune -f