New stuff in Docker and new README
Browse files- Dockerfile +9 -2
- README.md +26 -17
Dockerfile
CHANGED
|
@@ -2,10 +2,17 @@ FROM python:3.10-slim
|
|
| 2 |
|
| 3 |
WORKDIR /app
|
| 4 |
|
| 5 |
-
# System deps (for
|
| 6 |
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 7 |
libgl1 \
|
| 8 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
|
| 10 |
# Install only what we need to boot the server
|
| 11 |
COPY requirements.txt .
|
|
|
|
| 2 |
|
| 3 |
WORKDIR /app
|
| 4 |
|
| 5 |
+
# System deps (for ML libraries - including the missing libgthread)
|
| 6 |
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 7 |
libgl1 \
|
| 8 |
+
libgthread-2.0-0 \
|
| 9 |
+
libglib2.0-0 \
|
| 10 |
+
libcairo2 \
|
| 11 |
+
libpango-1.0-0 \
|
| 12 |
+
libpangocairo-1.0-0 \
|
| 13 |
+
libgdk-pixbuf2.0-0 \
|
| 14 |
+
libffi-dev \
|
| 15 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 16 |
|
| 17 |
# Install only what we need to boot the server
|
| 18 |
COPY requirements.txt .
|
README.md
CHANGED
|
@@ -1,15 +1,3 @@
|
|
| 1 |
-
---
|
| 2 |
-
title: ArteFact
|
| 3 |
-
emoji: 🏆
|
| 4 |
-
colorFrom: blue
|
| 5 |
-
colorTo: purple
|
| 6 |
-
sdk: docker
|
| 7 |
-
pinned: false
|
| 8 |
-
short_description: Discover insights into the art history corpus with visual AI
|
| 9 |
-
---
|
| 10 |
-
|
| 11 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
| 12 |
-
|
| 13 |
---
|
| 14 |
title: ArteFact
|
| 15 |
emoji: 🖼️
|
|
@@ -33,14 +21,35 @@ This branch contains the files required to run the **ArteFact** web app on Huggi
|
|
| 33 |
The full project documentation lives in the main GitHub repo (`main` branch).
|
| 34 |
|
| 35 |
## What runs here
|
| 36 |
-
- **Flask server** (`
|
| 37 |
-
- Built with the provided **Dockerfile**; the app listens on `$PORT` (set by Spaces)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 38 |
|
| 39 |
## Deploy / update
|
| 40 |
```bash
|
| 41 |
-
# one-time
|
| 42 |
git remote add hf https://huggingface.co/spaces/samwaugh/ArteFact
|
| 43 |
|
| 44 |
# deploy this branch to the Space
|
| 45 |
-
git push hf space:main
|
| 46 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
title: ArteFact
|
| 3 |
emoji: 🖼️
|
|
|
|
| 21 |
The full project documentation lives in the main GitHub repo (`main` branch).
|
| 22 |
|
| 23 |
## What runs here
|
| 24 |
+
- **Flask server** (`backend/runner/app.py`) serving the SPA from `frontend/` (UI + API share one origin)
|
| 25 |
+
- Built with the provided **Dockerfile**; the app listens on `$PORT` (set by Spaces)
|
| 26 |
+
- **Phase 1**: Stub mode with fake ML responses (`STUB_MODE=1`)
|
| 27 |
+
- **Phase 2**: Full ML inference with CLIP and PaintingCLIP models
|
| 28 |
+
|
| 29 |
+
## Current Status
|
| 30 |
+
- ✅ **Phase 1 Complete**: Basic Flask app with stub responses
|
| 31 |
+
- 🔄 **Phase 2 In Progress**: Real ML inference integration
|
| 32 |
+
- **Dataset**: Small test corpus (~1.5GB) for development
|
| 33 |
|
| 34 |
## Deploy / update
|
| 35 |
```bash
|
| 36 |
+
# one-time setup
|
| 37 |
git remote add hf https://huggingface.co/spaces/samwaugh/ArteFact
|
| 38 |
|
| 39 |
# deploy this branch to the Space
|
| 40 |
+
git push hf space-clean:main
|
| 41 |
+
|
| 42 |
+
# force rebuild if needed
|
| 43 |
+
# (use Hugging Face Space settings → Factory Reset)
|
| 44 |
+
```
|
| 45 |
+
|
| 46 |
+
## Environment Variables
|
| 47 |
+
- `STUB_MODE`: Set to `1` for stub responses, `0` for real ML
|
| 48 |
+
- `DATA_ROOT`: Data directory path (default: `/data`)
|
| 49 |
+
- `PORT`: Server port (set by Hugging Face)
|
| 50 |
+
|
| 51 |
+
## Architecture
|
| 52 |
+
- **Backend**: Flask API with ML inference pipeline
|
| 53 |
+
- **Frontend**: Single-page application (HTML/CSS/JS)
|
| 54 |
+
- **Models**: CLIP base + PaintingCLIP LoRA fine-tune
|
| 55 |
+
- **Data**: Consolidated embeddings with metadata
|