Skip to content

Commit

Permalink
fix ollama env
Browse files Browse the repository at this point in the history
  • Loading branch information
selimseker committed Sep 6, 2024
1 parent 31c70fc commit 79787b6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
12 changes: 12 additions & 0 deletions .github/workflows/build_and_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,18 @@ jobs:
# copy exe to zip folder
cd node_exe
if [ ! -f dkn-compute-node-exe.zip ]; then
echo "Error: ZIP file not found!"
exit 1
fi
# Test the ZIP file for corruption
unzip -t dkn-compute-node-exe.zip
if [ $? -ne 0 ]; then
echo "Error: Corrupted ZIP file!"
exit 1
fi
unzip dkn-compute-node-exe.zip
cp dkn-compute${{ matrix.extension }} ../$FOLDER_NAME/dkn-compute${{ matrix.extension }}
cd ..
Expand Down
3 changes: 2 additions & 1 deletion utils/ollama.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ var (
DEFAULT_OLLAMA_PORT = 11434
LOCAL_HOST = "http://localhost"
OLLAMA_MAX_RETRIES = 5
DOCKER_HOST = "http://host.docker.internal"
)

// IsOllamaRequired checks if any of the picked models are in the list of Ollama models,
Expand Down Expand Up @@ -102,7 +103,7 @@ func HandleOllamaEnv(ollamaHost, ollamaPort string) (string, string) {
// if not script runs ollama serve command manually and stores its pid

// prepare local ollama url
if ollamaHost == "" {
if ollamaHost == "" || ollamaHost == DOCKER_HOST {
ollamaHost = LOCAL_HOST
}
if ollamaPort == "" {
Expand Down

0 comments on commit 79787b6

Please sign in to comment.