NitinBot001 commited on
Commit
19bdd67
·
verified ·
1 Parent(s): 41a6c65

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +8 -2
Dockerfile CHANGED
@@ -1,4 +1,4 @@
1
- # Dockerfile for Hugging Face Spaces
2
  FROM ollama/ollama:latest
3
 
4
  # Create ollama user and set up directories with proper permissions
@@ -8,9 +8,15 @@ RUN useradd -m -u 1000 ollama && \
8
 
9
  # Set environment variables for Hugging Face Spaces
10
  ENV OLLAMA_HOST=0.0.0.0:7860
11
- ENV OLLAMA_PORT=7860
12
  ENV OLLAMA_MODELS=/home/ollama/.ollama/models
13
 
 
 
 
 
 
 
 
14
  # Switch to ollama user
15
  USER ollama
16
  WORKDIR /home/ollama
 
1
+ # Dockerfile for Hugging Face Spaces - Optimized for Performance
2
  FROM ollama/ollama:latest
3
 
4
  # Create ollama user and set up directories with proper permissions
 
8
 
9
  # Set environment variables for Hugging Face Spaces
10
  ENV OLLAMA_HOST=0.0.0.0:7860
 
11
  ENV OLLAMA_MODELS=/home/ollama/.ollama/models
12
 
13
+ # Performance optimizations
14
+ ENV OLLAMA_NUM_PARALLEL=4
15
+ ENV OLLAMA_MAX_LOADED_MODELS=1
16
+ ENV OLLAMA_CONTEXT_LENGTH=8196
17
+ ENV OLLAMA_KEEP_ALIVE=1m
18
+ ENV OLLAMA_CPU_THREADS=4
19
+
20
  # Switch to ollama user
21
  USER ollama
22
  WORKDIR /home/ollama