thomas123FU2 commited on
Commit
5a589b8
·
verified ·
1 Parent(s): 48ff424

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +6 -35
Dockerfile CHANGED
@@ -1,47 +1,18 @@
1
- # Use the specified base image for llama.cpp
2
  FROM ghcr.io/ggml-org/llama.cpp:full
3
 
4
- # Set the working directory inside the container
5
  WORKDIR /app
6
 
7
- # 1. Update package lists and install necessary Python dependencies
8
- # We install Python tools and ensure the environment is set up.
9
- RUN apt update && apt install -y \
10
- python3 \
11
- python3-pip \
12
- python3-venv \
13
- # Optional: Add basic network utilities for robustness
14
- curl \
15
- wget
16
-
17
- # 2. Create and set up a virtual environment for clean dependency management
18
  RUN python3 -m venv /opt/venv
19
  ENV PATH="/opt/venv/bin:$PATH"
20
 
21
- # 3. Install Python packages
22
- # Install huggingface_hub, which is necessary for downloading models
23
  RUN pip install -U pip huggingface_hub
24
 
25
- # 4. Download required GGUF model files from Hugging Face Hub
26
- # This step requires internet access during the build time.
27
- RUN python3 -c '
28
- import sys
29
- from huggingface_hub import hf_hub_download
30
-
31
- repo = "HauhauCS/Gemma-4-E2B-Uncensored-HauhauCS-Aggressive"
32
-
33
- print(f"Downloading model files from repo: {repo}")
34
-
35
- # Download the main GGUF file
36
- hf_hub_download(repo_id=repo, filename="Gemma-4-E2B-Uncensored-HauhauCS-Aggressive-Q6_K_P.gguf", local_dir="/app")
37
-
38
- # Download the matrix multiplication projection file
39
- hf_hub_download(repo_id=repo, filename="mmproj-Gemma-4-E2B-Uncensored-HauhauCS-Aggressive-f16.gguf", local_dir="/app")
40
-
41
- print("Model download complete.")
42
- '
43
 
44
- # 5. Define the command to run the llama.cpp server
45
  CMD ["--server", \
46
  "-m", "/app/Gemma-4-E2B-Uncensored-HauhauCS-Aggressive-Q6_K_P.gguf", \
47
  "--mmproj", "/app/mmproj-Gemma-4-E2B-Uncensored-HauhauCS-Aggressive-f16.gguf", \
@@ -51,4 +22,4 @@ CMD ["--server", \
51
  "--cache-type-k", "q8_0", \
52
  "--cache-type-v", "iq4_nl", \
53
  "-c", "128000", \
54
- "-n", "38912"]
 
 
1
  FROM ghcr.io/ggml-org/llama.cpp:full
2
 
 
3
  WORKDIR /app
4
 
5
+ RUN apt update && apt install -y python3 python3-pip python3-venv
 
 
 
 
 
 
 
 
 
 
6
  RUN python3 -m venv /opt/venv
7
  ENV PATH="/opt/venv/bin:$PATH"
8
 
 
 
9
  RUN pip install -U pip huggingface_hub
10
 
11
+ RUN python3 -c 'from huggingface_hub import hf_hub_download; \
12
+ repo="HauhauCS/Gemma-4-E2B-Uncensored-HauhauCS-Aggressive"; \
13
+ hf_hub_download(repo_id=repo, filename="Gemma-4-E2B-Uncensored-HauhauCS-Aggressive-Q6_K_P.gguf", local_dir="/app"); \
14
+ hf_hub_download(repo_id=repo, filename="mmproj-Gemma-4-E2B-Uncensored-HauhauCS-Aggressive-f16.gguf", local_dir="/app")'
 
 
 
 
 
 
 
 
 
 
 
 
 
 
15
 
 
16
  CMD ["--server", \
17
  "-m", "/app/Gemma-4-E2B-Uncensored-HauhauCS-Aggressive-Q6_K_P.gguf", \
18
  "--mmproj", "/app/mmproj-Gemma-4-E2B-Uncensored-HauhauCS-Aggressive-f16.gguf", \
 
22
  "--cache-type-k", "q8_0", \
23
  "--cache-type-v", "iq4_nl", \
24
  "-c", "128000", \
25
+ "-n", "38912"]