batmanLovesAI commited on
Commit
80609d0
·
1 Parent(s): fcbb696

more optimization

Browse files
Files changed (4) hide show
  1. .dockerignore +7 -0
  2. .gitignore +1 -0
  3. Dockerfile +1 -1
  4. start.sh +9 -2
.dockerignore ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ .git
2
+ .gitignore
3
+ README.md
4
+ __pycache__
5
+ *.pyc
6
+ .env
7
+ test.py
.gitignore ADDED
@@ -0,0 +1 @@
 
 
1
+ test.py
Dockerfile CHANGED
@@ -1,4 +1,4 @@
1
- FROM ollama/ollama
2
 
3
  # Pull model during build
4
  RUN ollama serve & \
 
1
+ FROM ollama/ollama:latest
2
 
3
  # Pull model during build
4
  RUN ollama serve & \
start.sh CHANGED
@@ -1,7 +1,14 @@
1
  #!/bin/sh
2
 
3
- # Listen on HF's expected port
4
  export OLLAMA_HOST=0.0.0.0:7860
5
 
6
- # Start Ollama in foreground
 
 
 
 
 
 
 
 
7
  exec ollama serve
 
1
  #!/bin/sh
2
 
 
3
  export OLLAMA_HOST=0.0.0.0:7860
4
 
5
+ # Keep model loaded forever
6
+ export OLLAMA_KEEP_ALIVE=-1
7
+
8
+ # Slightly increase concurrency
9
+ export OLLAMA_NUM_PARALLEL=4
10
+
11
+ # Larger queue
12
+ export OLLAMA_MAX_QUEUE=1024
13
+
14
  exec ollama serve