Spaces:
Runtime error
Runtime error
fix: Add model file and database, configure Git LFS for Docker deployment
Browse files- .gitignore +0 -1
- Dockerfile +8 -3
- database.csv +0 -0
- models/ViT-B-16_laion2b-s34b-b88k_model.pth +3 -0
.gitignore
CHANGED
|
@@ -15,7 +15,6 @@ env/
|
|
| 15 |
.idea/
|
| 16 |
|
| 17 |
# Git LFS
|
| 18 |
-
models/
|
| 19 |
|
| 20 |
# Temporary files
|
| 21 |
temp_reqs.txt
|
|
|
|
| 15 |
.idea/
|
| 16 |
|
| 17 |
# Git LFS
|
|
|
|
| 18 |
|
| 19 |
# Temporary files
|
| 20 |
temp_reqs.txt
|
Dockerfile
CHANGED
|
@@ -5,7 +5,8 @@ FROM python:3.9-slim
|
|
| 5 |
WORKDIR /app
|
| 6 |
|
| 7 |
# Install Git LFS (needed for model files)
|
| 8 |
-
|
|
|
|
| 9 |
|
| 10 |
# Copy requirements first to leverage Docker caching
|
| 11 |
COPY requirements.txt requirements.txt
|
|
@@ -15,10 +16,14 @@ COPY requirements.txt requirements.txt
|
|
| 15 |
# Using --prefer-binary for faster installs where available
|
| 16 |
RUN pip install --no-cache-dir --prefer-binary -r requirements.txt
|
| 17 |
|
| 18 |
-
# Copy the rest of the application code
|
| 19 |
COPY . .
|
| 20 |
|
| 21 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
RUN mkdir -p models
|
| 23 |
|
| 24 |
# Expose the port Gradio will run on (default 7860)
|
|
|
|
| 5 |
WORKDIR /app
|
| 6 |
|
| 7 |
# Install Git LFS (needed for model files)
|
| 8 |
+
# Also install git itself, as it might not be in python:3.9-slim and is needed by LFS
|
| 9 |
+
RUN apt-get update && apt-get install -y git git-lfs && git-lfs install --system
|
| 10 |
|
| 11 |
# Copy requirements first to leverage Docker caching
|
| 12 |
COPY requirements.txt requirements.txt
|
|
|
|
| 16 |
# Using --prefer-binary for faster installs where available
|
| 17 |
RUN pip install --no-cache-dir --prefer-binary -r requirements.txt
|
| 18 |
|
| 19 |
+
# Copy the rest of the application code (including LFS pointer files)
|
| 20 |
COPY . .
|
| 21 |
|
| 22 |
+
# Pull LFS files (download the actual model specified in .gitattributes)
|
| 23 |
+
RUN git lfs pull
|
| 24 |
+
|
| 25 |
+
# Make model directory if it doesn't exist (though LFS pull should handle it)
|
| 26 |
+
# This is more of a safeguard if no LFS files are present but the dir is expected
|
| 27 |
RUN mkdir -p models
|
| 28 |
|
| 29 |
# Expose the port Gradio will run on (default 7860)
|
database.csv
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
models/ViT-B-16_laion2b-s34b-b88k_model.pth
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d60974eb7a14505f517647d06a2ef0ded5138af75505729f6304881d88dc6a6a
|
| 3 |
+
size 598602807
|