Spaces:
Runtime error
Runtime error
deploy
Browse files- Dockerfile +3 -3
- main.py +1 -1
Dockerfile
CHANGED
|
@@ -1,11 +1,11 @@
|
|
| 1 |
# Use an official Python base image
|
| 2 |
-
FROM python:3.
|
| 3 |
|
| 4 |
# Set the working directory inside the container
|
| 5 |
WORKDIR /app
|
| 6 |
|
| 7 |
-
# Set
|
| 8 |
-
ENV
|
| 9 |
|
| 10 |
# Copy the requirements file
|
| 11 |
COPY requirements.txt .
|
|
|
|
| 1 |
# Use an official Python base image
|
| 2 |
+
FROM python:3.11-slim
|
| 3 |
|
| 4 |
# Set the working directory inside the container
|
| 5 |
WORKDIR /app
|
| 6 |
|
| 7 |
+
# Set Hugging Face cache directory to a writable location
|
| 8 |
+
ENV HF_HOME="/tmp/huggingface"
|
| 9 |
|
| 10 |
# Copy the requirements file
|
| 11 |
COPY requirements.txt .
|
main.py
CHANGED
|
@@ -4,7 +4,7 @@ from sentence_transformers import SentenceTransformer
|
|
| 4 |
import numpy as np
|
| 5 |
|
| 6 |
import os
|
| 7 |
-
os.environ["
|
| 8 |
# Initialize FastAPI app
|
| 9 |
app = FastAPI()
|
| 10 |
|
|
|
|
| 4 |
import numpy as np
|
| 5 |
|
| 6 |
import os
|
| 7 |
+
os.environ["HF_HOME"] = "/tmp/huggingface"
|
| 8 |
# Initialize FastAPI app
|
| 9 |
app = FastAPI()
|
| 10 |
|