Spaces:
Sleeping
Sleeping
Commit
·
84b6705
1
Parent(s):
2d458d6
update
Browse files- Dockerfile +8 -9
- requirements.txt +5 -4
Dockerfile
CHANGED
@@ -1,8 +1,8 @@
|
|
1 |
-
FROM python:3.
|
2 |
|
3 |
WORKDIR /code
|
4 |
|
5 |
-
#
|
6 |
COPY packages.txt /root/packages.txt
|
7 |
RUN apt-get update && \
|
8 |
xargs -r -a /root/packages.txt apt-get install -y && \
|
@@ -10,18 +10,17 @@ RUN apt-get update && \
|
|
10 |
|
11 |
# Install Python dependencies
|
12 |
COPY requirements.txt .
|
13 |
-
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
14 |
-
pip install --no-cache-dir llama-cpp-python==0.3.8 --extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cpu
|
15 |
|
16 |
-
#
|
17 |
-
|
18 |
-
RUN mkdir -p /code/.cache/huggingface && \
|
19 |
-
pip install --no-cache-dir huggingface_hub && \
|
20 |
-
python -c "from huggingface_hub import hf_hub_download; hf_hub_download(repo_id='muhammadnoman76/cortex_q4', filename='unsloth.Q4_K_M.gguf', local_dir='/code', local_dir_use_symlinks=False)"
|
21 |
|
22 |
# Copy application code
|
23 |
COPY . .
|
24 |
|
|
|
|
|
|
|
25 |
# Expose port
|
26 |
EXPOSE 7860
|
27 |
|
|
|
1 |
+
FROM python:3.10-slim
|
2 |
|
3 |
WORKDIR /code
|
4 |
|
5 |
+
# Copy packages.txt and install system dependencies
|
6 |
COPY packages.txt /root/packages.txt
|
7 |
RUN apt-get update && \
|
8 |
xargs -r -a /root/packages.txt apt-get install -y && \
|
|
|
10 |
|
11 |
# Install Python dependencies
|
12 |
COPY requirements.txt .
|
13 |
+
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
|
|
14 |
|
15 |
+
# Install llama-cpp-python separately to handle potential issues
|
16 |
+
RUN pip install --no-cache-dir llama-cpp-python
|
|
|
|
|
|
|
17 |
|
18 |
# Copy application code
|
19 |
COPY . .
|
20 |
|
21 |
+
# Ensure correct permissions for the working directory
|
22 |
+
RUN chmod -R 777 /code
|
23 |
+
|
24 |
# Expose port
|
25 |
EXPOSE 7860
|
26 |
|
requirements.txt
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
-
fastapi
|
2 |
-
uvicorn
|
3 |
-
pydantic
|
4 |
-
|
|
|
|
1 |
+
fastapi>=0.115.12
|
2 |
+
uvicorn>=0.34.2
|
3 |
+
pydantic>=2.11.4
|
4 |
+
llama-cpp-python>=0.3.8
|
5 |
+
huggingface_hub>=0.25.0
|