Shazaaly
commited on
Commit
·
7a8d8be
1
Parent(s):
ea7ba48
Fix write permissions by moving cache to /app
Browse files- Dockerfile +0 -2
- run.sh +3 -7
Dockerfile
CHANGED
|
@@ -5,8 +5,6 @@ FROM python:3.10-slim
|
|
| 5 |
ENV HF_HOME=/data
|
| 6 |
ENV PYTHONUNBUFFERED=1
|
| 7 |
|
| 8 |
-
# Create Hugging Face hub directory
|
| 9 |
-
RUN mkdir -p /data/hub
|
| 10 |
|
| 11 |
# Set working directory
|
| 12 |
WORKDIR /app
|
|
|
|
| 5 |
ENV HF_HOME=/data
|
| 6 |
ENV PYTHONUNBUFFERED=1
|
| 7 |
|
|
|
|
|
|
|
| 8 |
|
| 9 |
# Set working directory
|
| 10 |
WORKDIR /app
|
run.sh
CHANGED
|
@@ -1,12 +1,8 @@
|
|
| 1 |
#!/bin/bash
|
| 2 |
|
| 3 |
-
|
| 4 |
-
export
|
| 5 |
|
| 6 |
-
# Create the directory that the transformers library will try to use.
|
| 7 |
-
# The -p flag ensures it doesn't fail if the directory already exists.
|
| 8 |
mkdir -p $HF_HOME/hub
|
| 9 |
|
| 10 |
-
|
| 11 |
-
# Using exec means this script will be replaced by the uvicorn process, which is efficient.
|
| 12 |
-
exec uvicorn app:app --host 0.0.0.0 --port 7860
|
|
|
|
| 1 |
#!/bin/bash
|
| 2 |
|
| 3 |
+
export HF_HOME=/app/cache
|
| 4 |
+
export TRANSFORMERS_CACHE=/app/cache
|
| 5 |
|
|
|
|
|
|
|
| 6 |
mkdir -p $HF_HOME/hub
|
| 7 |
|
| 8 |
+
exec uvicorn app:app --host 0.0.0.0 --port 7860
|
|
|
|
|
|