Spaces:
Paused
Paused
Create Dockerfile
Browse files- Dockerfile +21 -0
Dockerfile
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Chọn image cơ bản (có CUDA nếu cần GPU)
|
| 2 |
+
FROM ubuntu:22.04
|
| 3 |
+
|
| 4 |
+
# Cài đặt các thư viện cần thiết
|
| 5 |
+
RUN apt-get update && apt-get install -y \
|
| 6 |
+
unzip wget curl python3 python3-pip
|
| 7 |
+
|
| 8 |
+
# Sao chép file binary đã build vào container
|
| 9 |
+
COPY llama_bin.zip /app/llama_bin.zip
|
| 10 |
+
WORKDIR /app
|
| 11 |
+
|
| 12 |
+
# Giải nén binaries
|
| 13 |
+
RUN unzip llama_bin.zip && rm llama_bin.zip && chmod +x bin/server
|
| 14 |
+
|
| 15 |
+
# Sao chép model (hoặc tải nếu cần)
|
| 16 |
+
COPY models /models
|
| 17 |
+
# Hoặc tải nếu mô hình chưa có
|
| 18 |
+
# RUN wget -O /models/llama-7b.gguf https://huggingface.co/TheBloke/Llama-2-7B-GGUF/resolve/main/llama-2-7b.Q4_K_M.gguf
|
| 19 |
+
|
| 20 |
+
# Chạy server
|
| 21 |
+
CMD ["./bin/server", "-m", "/models/llama-7b.gguf", "-p", "8000"]
|