Spaces:
Running
Running
Update Dockerfile
Browse files- Dockerfile +6 -26
Dockerfile
CHANGED
@@ -1,13 +1,10 @@
|
|
1 |
FROM python:3.10-slim
|
2 |
|
3 |
-
# Install system dependencies
|
4 |
RUN apt-get update && apt-get install -y \
|
5 |
ffmpeg \
|
6 |
git \
|
7 |
curl \
|
8 |
-
build-essential \
|
9 |
-
cmake \
|
10 |
-
libgomp1 \
|
11 |
&& apt-get clean && rm -rf /var/lib/apt/lists/*
|
12 |
|
13 |
# Set working directory
|
@@ -16,29 +13,12 @@ WORKDIR /app
|
|
16 |
# Copy application files
|
17 |
COPY . /app
|
18 |
|
19 |
-
# Install Python dependencies
|
20 |
RUN pip install --upgrade pip \
|
21 |
-
&& pip install
|
22 |
-
torch==2.1.0+cpu torchvision==0.16.0+cpu torchaudio==2.1.0+cpu \
|
23 |
-
&& pip install -r requirements.txt \
|
24 |
-
&& pip install huggingface_hub
|
25 |
|
26 |
-
|
27 |
-
# Download GGUF model at build time into models/
|
28 |
-
RUN mkdir -p models \
|
29 |
-
&& python - <<EOF
|
30 |
-
from huggingface_hub import hf_hub_download
|
31 |
-
hf_hub_download(
|
32 |
-
repo_id="TheBloke/Mistral-7B-Instruct-GPTQ",
|
33 |
-
filename="mistral-7b-instruct-q4_k_m.gguf",
|
34 |
-
cache_dir="models",
|
35 |
-
library_name="llama-cpp-python"
|
36 |
-
)
|
37 |
-
EOF
|
38 |
-
|
39 |
-
# Expose port 7860 for Flask app
|
40 |
EXPOSE 7860
|
41 |
|
42 |
-
#
|
43 |
-
CMD ["python", "app.py"]
|
44 |
-
|
|
|
1 |
FROM python:3.10-slim
|
2 |
|
3 |
+
# Install system dependencies
|
4 |
RUN apt-get update && apt-get install -y \
|
5 |
ffmpeg \
|
6 |
git \
|
7 |
curl \
|
|
|
|
|
|
|
8 |
&& apt-get clean && rm -rf /var/lib/apt/lists/*
|
9 |
|
10 |
# Set working directory
|
|
|
13 |
# Copy application files
|
14 |
COPY . /app
|
15 |
|
16 |
+
# Install Python dependencies (including OpenAI SDK)
|
17 |
RUN pip install --upgrade pip \
|
18 |
+
&& pip install -r requirements.txt
|
|
|
|
|
|
|
19 |
|
20 |
+
# Expose Flask port
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
21 |
EXPOSE 7860
|
22 |
|
23 |
+
# Run the Flask application
|
24 |
+
CMD ["python", "app.py"]
|
|