fix: set OLLAMA_HOST explicitly for model pull
- ollama pull failed because the CLI didn't know where the server was - Uses OLLAMA_HOST=http://127.0.0.1:11434 to connect regardless of user
This commit is contained in:
parent
bc5a5172dc
commit
b7fddf0069
1 changed files with 3 additions and 6 deletions
|
|
@ -199,12 +199,9 @@ case "$AI_CHOICE" in
|
|||
sleep 2
|
||||
done
|
||||
info "Pulling model $AI_MODEL (this may take a while)..."
|
||||
# Pull as the ollama user so models are in the right place
|
||||
if id -u ollama &>/dev/null; then
|
||||
sudo -u ollama ollama pull "$AI_MODEL" 2>&1 | tail -3
|
||||
else
|
||||
ollama pull "$AI_MODEL" 2>&1 | tail -3
|
||||
fi
|
||||
# Pull explicitly via the API URL so it works regardless of which user
|
||||
# runs the command (the Ollama service listens on 127.0.0.1:11434)
|
||||
sudo_if sh -c "OLLAMA_HOST=http://127.0.0.1:11434 ollama pull $AI_MODEL" 2>&1 | tail -3
|
||||
AI_BASE_URL="http://localhost:11434"
|
||||
;;
|
||||
*)
|
||||
|
|
|
|||
Loading…
Reference in a new issue