Spaces:
Runtime error
Runtime error
Update Dockerfile
Browse files- Dockerfile +6 -56
Dockerfile
CHANGED
|
@@ -1,64 +1,14 @@
|
|
| 1 |
-
FROM python:3.
|
| 2 |
|
| 3 |
WORKDIR /code
|
| 4 |
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
software-properties-common \
|
| 10 |
-
git \
|
| 11 |
-
ffmpeg \
|
| 12 |
-
libsndfile1 \
|
| 13 |
-
&& rm -rf /var/lib/apt/lists/*
|
| 14 |
|
| 15 |
-
|
| 16 |
-
RUN mkdir -p /.cache && \
|
| 17 |
-
chmod -R 777 /.cache && \
|
| 18 |
-
mkdir -p /.cache/huggingface && \
|
| 19 |
-
chmod -R 777 /.cache/huggingface
|
| 20 |
|
| 21 |
-
# Set environment variables
|
| 22 |
-
ENV TRANSFORMERS_CACHE=/.cache/huggingface
|
| 23 |
-
ENV HF_HOME=/.cache/huggingface
|
| 24 |
-
ENV PYTHONUNBUFFERED=1
|
| 25 |
-
ENV DEBIAN_FRONTEND=noninteractive
|
| 26 |
-
ENV HOME=/.cache
|
| 27 |
-
ENV TRUST_REMOTE_CODE=1
|
| 28 |
-
ENV TRANSFORMERS_OFFLINE=1
|
| 29 |
-
|
| 30 |
-
# Copy requirements first for better caching
|
| 31 |
-
COPY requirements.txt .
|
| 32 |
-
|
| 33 |
-
# Install Python dependencies
|
| 34 |
-
RUN pip install --no-cache-dir --upgrade pip && \
|
| 35 |
-
pip install --no-cache-dir \
|
| 36 |
-
numpy==1.24.3 \
|
| 37 |
-
torch==1.13.1 \
|
| 38 |
-
flask==2.0.1 \
|
| 39 |
-
flask-cors==5.0.1 \
|
| 40 |
-
transformers==4.30.2 \
|
| 41 |
-
sentence-transformers==2.2.2 \
|
| 42 |
-
huggingface-hub==0.16.4 \
|
| 43 |
-
accelerate==0.20.3 \
|
| 44 |
-
faiss-cpu==1.7.4 \
|
| 45 |
-
pandas==1.5.3 \
|
| 46 |
-
geopy==2.3.0 \
|
| 47 |
-
geocoder==1.38.1 \
|
| 48 |
-
cloudinary==1.33.0 \
|
| 49 |
-
pydub==0.25.1 \
|
| 50 |
-
SpeechRecognition==3.10.0 \
|
| 51 |
-
webrtcvad==2.0.10 \
|
| 52 |
-
happytransformer==2.4.1 \
|
| 53 |
-
Werkzeug==2.0.3 \
|
| 54 |
-
pyngrok==7.0.0 \
|
| 55 |
-
safetensors==0.3.1
|
| 56 |
-
|
| 57 |
-
# Copy the rest of the application
|
| 58 |
-
COPY . .
|
| 59 |
-
|
| 60 |
-
# Make port 7860 available
|
| 61 |
EXPOSE 7860
|
| 62 |
|
| 63 |
-
# Run the application
|
| 64 |
CMD ["python", "app.py"]
|
|
|
|
| 1 |
+
FROM python:3.11-slim
|
| 2 |
|
| 3 |
WORKDIR /code
|
| 4 |
|
| 5 |
+
COPY ./requirements.txt /code/requirements.txt
|
| 6 |
+
COPY ./app.py /code/app.py
|
| 7 |
+
COPY ./templates /code/templates
|
| 8 |
+
COPY ./models /code/models
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
|
| 10 |
+
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
EXPOSE 7860
|
| 13 |
|
|
|
|
| 14 |
CMD ["python", "app.py"]
|