Spaces:
Runtime error
Runtime error
Commit
·
0fd692d
1
Parent(s):
ebe3da3
Updated Dockerfile and requirements for Hugging Face
Browse files- Dockerfile +15 -6
- Web_app/app.py +0 -1
- requirements.txt +1 -1
Dockerfile
CHANGED
@@ -11,21 +11,30 @@ RUN apt-get update && apt-get install -y \
|
|
11 |
ffmpeg \
|
12 |
&& rm -rf /var/lib/apt/lists/*
|
13 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
|
15 |
# Install Python dependencies
|
16 |
COPY Web_app/requirements.txt ./requirements.txt
|
17 |
RUN pip install --upgrade pip
|
18 |
RUN pip install --no-cache-dir -r requirements.txt
|
19 |
|
|
|
|
|
|
|
|
|
20 |
# Copy application code
|
21 |
COPY Web_app .
|
22 |
|
23 |
-
#
|
24 |
-
ENV MPLCONFIGDIR=/tmp
|
25 |
-
ENV YOLO_CONFIG_DIR=/tmp
|
26 |
-
|
27 |
-
# Expose the port Flask runs on
|
28 |
EXPOSE 5000
|
29 |
|
30 |
# Command to run the app
|
31 |
-
CMD ["python", "app.py"]
|
|
|
11 |
ffmpeg \
|
12 |
&& rm -rf /var/lib/apt/lists/*
|
13 |
|
14 |
+
# Create necessary directories
|
15 |
+
RUN mkdir -p uploads static
|
16 |
+
RUN mkdir -p /var/cache/fontconfig && chmod 777 /var/cache/fontconfig
|
17 |
+
|
18 |
+
# Set environment variables
|
19 |
+
ENV MPLCONFIGDIR=/tmp
|
20 |
+
ENV YOLO_CONFIG_DIR=/tmp
|
21 |
+
ENV FONTCONFIG_PATH=/var/cache/fontconfig
|
22 |
+
ENV OPENAI_API_KEY="your-openai-api-key"
|
23 |
|
24 |
# Install Python dependencies
|
25 |
COPY Web_app/requirements.txt ./requirements.txt
|
26 |
RUN pip install --upgrade pip
|
27 |
RUN pip install --no-cache-dir -r requirements.txt
|
28 |
|
29 |
+
# Explicitly install OpenAI Whisper
|
30 |
+
RUN pip install openai-whisper==20231117
|
31 |
+
RUN python -c "import whisper; print('Whisper installed successfully')"
|
32 |
+
|
33 |
# Copy application code
|
34 |
COPY Web_app .
|
35 |
|
36 |
+
# Expose the port for Hugging Face
|
|
|
|
|
|
|
|
|
37 |
EXPOSE 5000
|
38 |
|
39 |
# Command to run the app
|
40 |
+
CMD ["python", "app.py"]
|
Web_app/app.py
CHANGED
@@ -57,7 +57,6 @@ mp_drawing = mp.solutions.drawing_utils
|
|
57 |
mp_drawing_styles = mp.solutions.drawing_styles
|
58 |
|
59 |
# Load Whisper model for speech-to-text
|
60 |
-
import whisper
|
61 |
whisper_model = whisper.load_model("base") # ✅ This is correct!
|
62 |
|
63 |
|
|
|
57 |
mp_drawing_styles = mp.solutions.drawing_styles
|
58 |
|
59 |
# Load Whisper model for speech-to-text
|
|
|
60 |
whisper_model = whisper.load_model("base") # ✅ This is correct!
|
61 |
|
62 |
|
requirements.txt
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
|
2 |
absl-py==2.1.0
|
3 |
annotated-types==0.7.0
|
4 |
anyio==4.9.0
|
|
|
1 |
+
# openai-whisper==20231117
|
2 |
absl-py==2.1.0
|
3 |
annotated-types==0.7.0
|
4 |
anyio==4.9.0
|