Spaces:
Running
Running
Upload 3 files
Browse files- .dockerignore +13 -0
- dockerfile +34 -0
- requirements.txt +14 -0
.dockerignore
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# System files
|
| 2 |
+
|
| 3 |
+
.DS_Store
|
| 4 |
+
|
| 5 |
+
# Python cache
|
| 6 |
+
|
| 7 |
+
\*_/**pycache**/
|
| 8 |
+
_.pyc
|
| 9 |
+
|
| 10 |
+
# Local virtual environments
|
| 11 |
+
|
| 12 |
+
.venv/
|
| 13 |
+
venv/
|
dockerfile
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Use Python base image
|
| 2 |
+
FROM python:3.12
|
| 3 |
+
|
| 4 |
+
# Set working directory
|
| 5 |
+
WORKDIR /app
|
| 6 |
+
|
| 7 |
+
# Install system dependencies
|
| 8 |
+
RUN apt-get update && apt-get install -y \
|
| 9 |
+
git \
|
| 10 |
+
libgl1 \
|
| 11 |
+
libglib2.0-0 \
|
| 12 |
+
libsm6 \
|
| 13 |
+
libxext6 \
|
| 14 |
+
libxrender1 \
|
| 15 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 16 |
+
|
| 17 |
+
|
| 18 |
+
# Copy requirements file
|
| 19 |
+
COPY requirements.txt .
|
| 20 |
+
|
| 21 |
+
# Install Python dependencies
|
| 22 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
| 23 |
+
|
| 24 |
+
RUN python -c "import clip; clip.load('ViT-B/32', device = 'cpu', jit=False)"
|
| 25 |
+
|
| 26 |
+
# Copy the application code and models
|
| 27 |
+
COPY ./Apps ./Apps
|
| 28 |
+
COPY ./Lib/Models ./Models
|
| 29 |
+
|
| 30 |
+
# Expose the port
|
| 31 |
+
EXPOSE 8000
|
| 32 |
+
|
| 33 |
+
# Command to run the FastAPI application
|
| 34 |
+
CMD ["uvicorn", "Apps.app:app", "--host", "0.0.0.0", "--port", "8000"]
|
requirements.txt
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
fastapi
|
| 2 |
+
redis
|
| 3 |
+
types-redis
|
| 4 |
+
uvicorn
|
| 5 |
+
python-multipart
|
| 6 |
+
pillow
|
| 7 |
+
numpy
|
| 8 |
+
tensorflow
|
| 9 |
+
torch
|
| 10 |
+
transformers
|
| 11 |
+
opencv-contrib-python-headless>=4.7.0
|
| 12 |
+
git+https://github.com/openai/CLIP.git
|
| 13 |
+
scikit-learn
|
| 14 |
+
joblib
|