Abs6187 commited on
Commit
eea2701
·
verified ·
1 Parent(s): b51af55

Upload 3 files

Browse files
Files changed (3) hide show
  1. Dockerfile +39 -36
  2. app.py +6 -2
  3. requirements.txt +1 -0
Dockerfile CHANGED
@@ -1,36 +1,39 @@
1
- FROM python:3.11-slim
2
-
3
- WORKDIR /app
4
-
5
- # Install system dependencies
6
- RUN apt-get update && apt-get install -y \
7
- build-essential \
8
- curl \
9
- git \
10
- ffmpeg \
11
- libglib2.0-0 \
12
- && rm -rf /var/lib/apt/lists/*
13
-
14
- # Copy requirements first for better caching
15
- COPY requirements.txt .
16
-
17
- # Install PyTorch CPU version first
18
- RUN pip install --no-cache-dir torch==2.0.1+cpu --index-url https://download.pytorch.org/whl/cpu
19
-
20
- # Install other Python dependencies
21
- RUN pip install --no-cache-dir -r requirements.txt
22
-
23
- # Copy application code
24
- COPY . .
25
-
26
- # Set environment variables
27
- ENV PYTHONUNBUFFERED=1
28
- ENV STREAMLIT_SERVER_HEADLESS=true
29
- ENV STREAMLIT_SERVER_ENABLE_CORS=false
30
- ENV STREAMLIT_SERVER_PORT=8501
31
-
32
- # Expose port
33
- EXPOSE 8501
34
-
35
- # Run the app
36
- CMD ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0"]
 
 
 
 
1
+ FROM python:3.11-slim
2
+
3
+ WORKDIR /app
4
+
5
+ # Install system dependencies
6
+ RUN apt-get update && apt-get install -y \
7
+ build-essential \
8
+ curl \
9
+ git \
10
+ ffmpeg \
11
+ libglib2.0-0 \
12
+ && rm -rf /var/lib/apt/lists/*
13
+
14
+ # Copy requirements first for better caching
15
+ COPY requirements.txt .
16
+
17
+ # Install PyTorch CPU version first
18
+ RUN pip install --no-cache-dir torch==2.0.1+cpu --index-url https://download.pytorch.org/whl/cpu
19
+
20
+ # Install other Python dependencies
21
+ RUN pip install --no-cache-dir -r requirements.txt
22
+
23
+ # Copy application code
24
+ COPY . .
25
+
26
+ # Set environment variables
27
+ ENV PYTHONUNBUFFERED=1
28
+ ENV STREAMLIT_SERVER_HEADLESS=true
29
+ ENV STREAMLIT_SERVER_ENABLE_CORS=false
30
+ ENV STREAMLIT_SERVER_PORT=8501
31
+ ENV HF_HOME=/tmp/huggingface
32
+ ENV TRANSFORMERS_CACHE=/tmp/transformers
33
+ ENV KERAS_BACKEND=tensorflow
34
+
35
+ # Expose port
36
+ EXPOSE 8501
37
+
38
+ # Run the app
39
+ CMD ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0"]
app.py CHANGED
@@ -27,7 +27,10 @@ st.write("🚀 TechMatrix Solvers ISL Translator Loading...")
27
  # Import dependencies with error handling
28
  try:
29
  import os
30
- os.environ["KERAS_BACKEND"] = "torch"
 
 
 
31
 
32
  # Core imports
33
  import numpy as np
@@ -354,7 +357,8 @@ st.markdown(
354
  }
355
 
356
  .team-info {
357
- background-color: #f0f2f6;
 
358
  padding: 1rem;
359
  border-radius: 0.5rem;
360
  margin: 1rem 0;
 
27
  # Import dependencies with error handling
28
  try:
29
  import os
30
+ # Set environment variables for better compatibility
31
+ os.environ["KERAS_BACKEND"] = "tensorflow"
32
+ os.environ["HF_HOME"] = "/tmp/huggingface"
33
+ os.environ["TRANSFORMERS_CACHE"] = "/tmp/transformers"
34
 
35
  # Core imports
36
  import numpy as np
 
357
  }
358
 
359
  .team-info {
360
+ background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
361
+ color: white;
362
  padding: 1rem;
363
  border-radius: 0.5rem;
364
  margin: 1rem 0;
requirements.txt CHANGED
@@ -6,6 +6,7 @@ Pillow==9.5.0
6
  matplotlib==3.7.2
7
  scipy==1.11.2
8
  tqdm==4.66.1
 
9
  keras==2.13.1
10
  huggingface-hub==0.17.3
11
  ffmpeg-python==0.2.0
 
6
  matplotlib==3.7.2
7
  scipy==1.11.2
8
  tqdm==4.66.1
9
+ tensorflow-cpu==2.13.0
10
  keras==2.13.1
11
  huggingface-hub==0.17.3
12
  ffmpeg-python==0.2.0