Spaces:
Sleeping
Sleeping
Added trained model
Browse files- Dockerfile +13 -10
- requirements.txt +10 -0
Dockerfile
CHANGED
|
@@ -1,19 +1,22 @@
|
|
| 1 |
-
|
|
|
|
| 2 |
|
|
|
|
| 3 |
WORKDIR /app
|
|
|
|
|
|
|
| 4 |
COPY . /app
|
| 5 |
|
| 6 |
-
ENV HF_HOME=/app/.cache
|
| 7 |
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
|
| 12 |
-
|
| 13 |
-
RUN pip install --no-cache-dir -r
|
| 14 |
-
RUN pip install uvicorn
|
| 15 |
-
RUN uvicorn --version
|
| 16 |
|
|
|
|
| 17 |
EXPOSE 7860
|
| 18 |
|
| 19 |
-
|
|
|
|
|
|
| 1 |
+
# Use official Python base image
|
| 2 |
+
FROM python:3.11-slim
|
| 3 |
|
| 4 |
+
# Set the working directory
|
| 5 |
WORKDIR /app
|
| 6 |
+
|
| 7 |
+
# Copy all files to the container
|
| 8 |
COPY . /app
|
| 9 |
|
|
|
|
| 10 |
|
| 11 |
+
# Set HF_HOME to use an accessible cache directory
|
| 12 |
+
ENV HF_HOME=/app/.cache
|
| 13 |
+
RUN mkdir -p /app/.cache && chmod -R 777 /app/.cache
|
| 14 |
|
| 15 |
+
# Install dependencies
|
| 16 |
+
RUN pip install --no-cache-dir -r Requirements.txt
|
|
|
|
|
|
|
| 17 |
|
| 18 |
+
# Expose port (Hugging Face uses port 7860 by default)
|
| 19 |
EXPOSE 7860
|
| 20 |
|
| 21 |
+
# Run the FastAPI server using uvicorn
|
| 22 |
+
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|
requirements.txt
CHANGED
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
fastapi
|
| 2 |
+
uvicorn
|
| 3 |
+
sentence-transformers
|
| 4 |
+
torch
|
| 5 |
+
scikit-learn
|
| 6 |
+
numpy
|
| 7 |
+
pandas
|
| 8 |
+
openpyxl
|
| 9 |
+
numpy
|
| 10 |
+
huggingface-hub
|