ffreemt commited on
Commit
82e73f9
·
1 Parent(s): b94b1e6

Add ollama serve

Browse files
Files changed (2) hide show
  1. nginx.conf.template +1 -1
  2. start.sh +5 -1
nginx.conf.template CHANGED
@@ -9,7 +9,7 @@ http {
9
  return 401 "Unauthorized: Invalid API Key\n";
10
  }
11
 
12
- proxy_pass http://localhost:11434;
13
  proxy_set_header Host $host;
14
  proxy_set_header X-Real-IP $remote_addr;
15
  }
 
9
  return 401 "Unauthorized: Invalid API Key\n";
10
  }
11
 
12
+ proxy_pass http://localhost:7876;
13
  proxy_set_header Host $host;
14
  proxy_set_header X-Real-IP $remote_addr;
15
  }
start.sh CHANGED
@@ -4,6 +4,8 @@
4
  # We bind it to port 7860 as expected by HF Spaces
5
  OLLAMA_HOST=0.0.0.0:7860 ollama serve &
6
 
 
 
7
  # Wait for the server to be ready
8
  until curl -s localhost:7860/api/tags > /dev/null; do
9
  echo "Waiting for Ollama server..."
@@ -23,7 +25,9 @@ else
23
  echo "Error: OLLAMA_API_KEY secret not found in Space settings."
24
  fi
25
 
26
- ollama ls
 
 
27
 
28
  # Keep the script running to keep the container alive
29
  wait
 
4
  # We bind it to port 7860 as expected by HF Spaces
5
  OLLAMA_HOST=0.0.0.0:7860 ollama serve &
6
 
7
+ ollama serve &
8
+
9
  # Wait for the server to be ready
10
  until curl -s localhost:7860/api/tags > /dev/null; do
11
  echo "Waiting for Ollama server..."
 
25
  echo "Error: OLLAMA_API_KEY secret not found in Space settings."
26
  fi
27
 
28
+
29
+ # Start Nginx (if using the proxy setup)
30
+ nginx -g "daemon on;"
31
 
32
  # Keep the script running to keep the container alive
33
  wait