Spaces:
Running
Running
Set TRANSFORMERS_CACHE environment variable to a writable directory
Browse files- Dockerfile +12 -5
- start.sh +10 -0
Dockerfile
CHANGED
|
@@ -1,10 +1,17 @@
|
|
| 1 |
-
FROM python:3.9
|
| 2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
WORKDIR /app
|
| 4 |
|
| 5 |
-
|
| 6 |
-
RUN pip install
|
| 7 |
|
| 8 |
-
|
|
|
|
| 9 |
|
| 10 |
-
|
|
|
|
|
|
| 1 |
+
FROM python:3.9
|
| 2 |
|
| 3 |
+
# Set the TRANSFORMERS_CACHE environment variable
|
| 4 |
+
ENV TRANSFORMERS_CACHE=/app/cache/huggingface/hub
|
| 5 |
+
|
| 6 |
+
# Copy your app code
|
| 7 |
+
COPY . /app
|
| 8 |
WORKDIR /app
|
| 9 |
|
| 10 |
+
# Install dependencies
|
| 11 |
+
RUN pip install -r requirements.txt
|
| 12 |
|
| 13 |
+
# Create the cache directory
|
| 14 |
+
RUN mkdir -p /app/cache/huggingface/hub
|
| 15 |
|
| 16 |
+
# Start the app
|
| 17 |
+
CMD ["python", "app.py"]
|
start.sh
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/bash
|
| 2 |
+
|
| 3 |
+
# Create the cache directory if it doesn't exist
|
| 4 |
+
mkdir -p ./cache/huggingface/hub
|
| 5 |
+
|
| 6 |
+
# Set the TRANSFORMERS_CACHE environment variable
|
| 7 |
+
export TRANSFORMERS_CACHE=$(pwd)/cache/huggingface/hub
|
| 8 |
+
|
| 9 |
+
# Start the app
|
| 10 |
+
python app.py
|