omkarshanbhag commited on
Commit
faeab97
·
verified ·
1 Parent(s): 1483d54

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +18 -0
Dockerfile ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # 1. Use the highly optimized C++ llama.cpp server
2
+ FROM ghcr.io/ggerganov/llama.cpp:server
3
+
4
+ # Switch to root temporarily to install missing packages
5
+ USER root
6
+ RUN apt-get update && apt-get install -y wget
7
+
8
+ # 2. Expose the port Hugging Face expects for web traffic
9
+ EXPOSE 7860
10
+
11
+ # 3. Download the 4-bit quantized Gemma 2 (2B) model during the build phase
12
+ RUN wget -O gemma-2b.gguf https://huggingface.co/bartowski/gemma-2-2b-it-GGUF/resolve/main/gemma-2-2b-it-Q4_K_M.gguf
13
+
14
+ # Switch back to a non-root user (Hugging Face Spaces requires running as User 1000)
15
+ USER 1000
16
+
17
+ # 4. Boot the server
18
+ CMD ["-m", "gemma-2b.gguf", "--host", "0.0.0.0", "--port", "7860", "-t", "2", "-c", "2048"]