Nafiul Huda commited on
Commit
4e4c24b
·
verified ·
1 Parent(s): 8ee66f1

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +25 -10
Dockerfile CHANGED
@@ -1,17 +1,32 @@
1
  FROM ghcr.io/ggml-org/llama.cpp:full
2
 
 
 
 
3
  WORKDIR /app
4
 
5
- # প্রয়োজনীয় প্যাকেজ ইনস্টল
6
- RUN apt update && apt install -y python3-pip
7
- RUN pip install -U huggingface_hub
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8
 
9
- # Hugging Face থেকে মডেল ডাউনলোড
10
- RUN python3 -c 'from huggingface_hub import hf_hub_download; \
11
- repo="LiquidAI/LFM2.5-1.2B-Instruct-GGUF"; \
12
- hf_hub_download(repo_id=repo, filename="LFM2.5-1.2B-Instruct-Q8_0.gguf", local_dir="/app");'
13
 
14
- # সার্ভার কনফিগারেশন (Thinking মোড ডিজেবল করা হয়েছে)
15
  ENTRYPOINT ["/app/llama-server"]
16
  CMD ["-m", "/app/LFM2.5-1.2B-Instruct-Q8_0.gguf", \
17
  "--host", "0.0.0.0", \
@@ -19,6 +34,6 @@ CMD ["-m", "/app/LFM2.5-1.2B-Instruct-Q8_0.gguf", \
19
  "-t", "2", \
20
  "--cache-type-k", "q4_0", \
21
  "--cache-type-v", "iq4_nl", \
22
- "-c", "128000", \
23
- "-n", "38912", \
24
  "--jinja"]
 
1
  FROM ghcr.io/ggml-org/llama.cpp:full
2
 
3
+ # Create non-root user (HF Spaces requirement)
4
+ RUN useradd -m -u 1000 user
5
+
6
  WORKDIR /app
7
 
8
+ # Install dependencies
9
+ RUN apt-get update && apt-get install -y --no-install-recommends python3-pip && \
10
+ rm -rf /var/lib/apt/lists/*
11
+ RUN pip install --no-cache-dir -U huggingface_hub[hf_transfer]
12
+
13
+ # Download model at build time
14
+ ENV HF_HUB_ENABLE_HF_TRANSFER=1
15
+ RUN python3 -c "\
16
+ from huggingface_hub import hf_hub_download; \
17
+ hf_hub_download( \
18
+ repo_id='LiquidAI/LFM2.5-1.2B-Instruct-GGUF', \
19
+ filename='LFM2.5-1.2B-Instruct-Q8_0.gguf', \
20
+ local_dir='/app' \
21
+ )"
22
+
23
+ # Fix permissions for HF Spaces
24
+ RUN chown -R user:user /app
25
+
26
+ USER user
27
 
28
+ EXPOSE 7860
 
 
 
29
 
 
30
  ENTRYPOINT ["/app/llama-server"]
31
  CMD ["-m", "/app/LFM2.5-1.2B-Instruct-Q8_0.gguf", \
32
  "--host", "0.0.0.0", \
 
34
  "-t", "2", \
35
  "--cache-type-k", "q4_0", \
36
  "--cache-type-v", "iq4_nl", \
37
+ "-c", "8192", \
38
+ "-n", "4096", \
39
  "--jinja"]