Spaces:
Sleeping
Sleeping
Commit ·
4803266
1
Parent(s): 2a741d4
fix: Use writable temp directory for document downloads
Browse files- Dockerfile +2 -2
- app/main_api.py +1 -1
Dockerfile
CHANGED
|
@@ -11,10 +11,10 @@ COPY ./requirements.txt /code/requirements.txt
|
|
| 11 |
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
|
| 12 |
|
| 13 |
# --- START: FINAL PERMISSION FIXES ---
|
| 14 |
-
# Create
|
| 15 |
RUN mkdir -p /code/cache && chmod 777 /code/cache
|
| 16 |
-
# Create a writable directory for the vector database
|
| 17 |
RUN mkdir -p /code/app/chroma_db && chmod -R 777 /code/app/chroma_db
|
|
|
|
| 18 |
# Tell all Hugging Face libraries to use the new cache directory
|
| 19 |
ENV HF_HOME=/code/cache
|
| 20 |
ENV SENTENCE_TRANSFORMERS_HOME=/code/cache
|
|
|
|
| 11 |
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
|
| 12 |
|
| 13 |
# --- START: FINAL PERMISSION FIXES ---
|
| 14 |
+
# Create writable directories for caches, databases, and temporary files.
|
| 15 |
RUN mkdir -p /code/cache && chmod 777 /code/cache
|
|
|
|
| 16 |
RUN mkdir -p /code/app/chroma_db && chmod -R 777 /code/app/chroma_db
|
| 17 |
+
RUN mkdir -p /tmp/docs && chmod 777 /tmp/docs # <-- ADD THIS LINE
|
| 18 |
# Tell all Hugging Face libraries to use the new cache directory
|
| 19 |
ENV HF_HOME=/code/cache
|
| 20 |
ENV SENTENCE_TRANSFORMERS_HOME=/code/cache
|
app/main_api.py
CHANGED
|
@@ -57,7 +57,7 @@ def get_next_api_key():
|
|
| 57 |
|
| 58 |
EMBEDDING_MODEL = "BAAI/bge-small-en-v1.5"
|
| 59 |
CHROMA_PERSIST_DIR = "./app/chroma_db"
|
| 60 |
-
UPLOAD_DIR = "
|
| 61 |
|
| 62 |
try:
|
| 63 |
embedding_model = SentenceTransformer(EMBEDDING_MODEL)
|
|
|
|
| 57 |
|
| 58 |
EMBEDDING_MODEL = "BAAI/bge-small-en-v1.5"
|
| 59 |
CHROMA_PERSIST_DIR = "./app/chroma_db"
|
| 60 |
+
UPLOAD_DIR = "/tmp/docs" # Use the writable temporary directory
|
| 61 |
|
| 62 |
try:
|
| 63 |
embedding_model = SentenceTransformer(EMBEDDING_MODEL)
|