muzammil-eds commited on
Commit
d9d3e5f
·
1 Parent(s): 89cb06a

Files added

Browse files
Files changed (2) hide show
  1. Dockerfile +3 -3
  2. app.py +2 -0
Dockerfile CHANGED
@@ -5,14 +5,14 @@ LABEL authors="muzammil"
5
  # Set the working directory inside the container
6
  WORKDIR /app
7
 
8
- # Set Hugging Face cache directory to a writable path
9
- ENV HF_HOME="/app/.cache"
10
 
11
  # Copy the current directory contents into the container at /app
12
  COPY . /app
13
 
14
  # Install any required dependencies
15
- RUN pip install --no-cache-dir -r requirements.txt
16
 
17
  # Expose the port Flask will run on
18
  EXPOSE 7860
 
5
  # Set the working directory inside the container
6
  WORKDIR /app
7
 
8
+ # Set Hugging Face cache directory to /tmp/.cache (which should be writable)
9
+ ENV HF_HOME="/tmp/.cache"
10
 
11
  # Copy the current directory contents into the container at /app
12
  COPY . /app
13
 
14
  # Install any required dependencies
15
+ RUN pip install -r requirements.txt
16
 
17
  # Expose the port Flask will run on
18
  EXPOSE 7860
app.py CHANGED
@@ -6,6 +6,8 @@ from transformers import Wav2Vec2ForCTC, Wav2Vec2Processor
6
  from io import BytesIO
7
  from flask_cors import CORS
8
  from pydub import AudioSegment # NEW
 
 
9
 
10
  app = Flask(__name__)
11
  CORS(app)
 
6
  from io import BytesIO
7
  from flask_cors import CORS
8
  from pydub import AudioSegment # NEW
9
+ import os
10
+ os.environ['HF_HOME'] = '/tmp/.cache'
11
 
12
  app = Flask(__name__)
13
  CORS(app)