docker / genai-stack

Langchain + Docker + Neo4j + Ollama
Creative Commons Zero v1.0 Universal
3.78k stars 806 forks source link

pulling ollama model llama2 using http://host.docker.internal:11434 pull-model-1 panic: $HOME is not defined #176

Open mishagavron opened 1 month ago

mishagavron commented 1 month ago

I am running genai-stack on my Mac and getting this error when I do: docker-compose up --build

pull-model-1 | pulling ollama model llama2 using http://host.docker.internal:11434 pull-model-1 | panic: $HOME is not defined pull-model-1 | pull-model-1 | goroutine 1 [running]: pull-model-1 | github.com/ollama/ollama/envconfig.Models() pull-model-1 | github.com/ollama/ollama/envconfig/config.go:93 +0xa9 pull-model-1 | github.com/ollama/ollama/envconfig.AsMap() pull-model-1 | github.com/ollama/ollama/envconfig/config.go:253 +0x699 pull-model-1 | github.com/ollama/ollama/cmd.NewCLI() pull-model-1 | github.com/ollama/ollama/cmd/cmd.go:1329 +0xb68 pull-model-1 | main.main() pull-model-1 | github.com/ollama/ollama/main.go:12 +0x13 pull-model-1 | panic: $HOME is not defined pull-model-1 | pull-model-1 | goroutine 1 [running]: pull-model-1 | github.com/ollama/ollama/envconfig.Models() pull-model-1 | github.com/ollama/ollama/envconfig/config.go:93 +0xa9 pull-model-1 | github.com/ollama/ollama/envconfig.AsMap() pull-model-1 | github.com/ollama/ollama/envconfig/config.go:253 +0x699 pull-model-1 | github.com/ollama/ollama/cmd.NewCLI() pull-model-1 | github.com/ollama/ollama/cmd/cmd.go:1329 +0xb68 pull-model-1 | main.main() pull-model-1 | github.com/ollama/ollama/main.go:12 +0x13 pull-model-1 exited with code 1

aubrey-ford-nutrien commented 3 weeks ago

Same here

aubrey-ford-nutrien commented 3 weeks ago

I removed the inline comments in my .env and it works now

image
gingaramo commented 3 weeks ago

Same, but removing the comments on the non-comment lines in .env didn't fix it.

gingaramo commented 3 weeks ago

Followed https://github.com/docker/genai-stack/issues/175, the fix was to add

(process/shell {:env {"OLLAMA_HOST" url "HOME" (System/getProperty "user.home")} :out :inherit :err :inherit} (format "bash -c './bin/ollama show %s --modelfile > /dev/null || ./bin/ollama pull %s'" llm llm))

In pull_model.Dockerfile. The run two commands:

docker compose down

docker compose up --build

flyboyer commented 2 weeks ago

same issue