Spaces:
Sleeping
Sleeping
Commit Β·
2950223
1
Parent(s): d3c04ef
Docker space: CreatorPulse India API
Browse files- Dockerfile +29 -0
- README.md +23 -9
Dockerfile
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# HF Spaces (Docker SDK) β CreatorPulse India API.
|
| 2 |
+
# Builds from the public GitHub repo; serves FastAPI on the HF-required port 7860.
|
| 3 |
+
FROM python:3.11-slim
|
| 4 |
+
|
| 5 |
+
RUN apt-get update && apt-get install -y --no-install-recommends git \
|
| 6 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 7 |
+
|
| 8 |
+
# HF Spaces runs the container as uid 1000 β set up that user + a writable model cache.
|
| 9 |
+
RUN useradd -m -u 1000 user
|
| 10 |
+
USER user
|
| 11 |
+
ENV HOME=/home/user \
|
| 12 |
+
PATH=/home/user/.local/bin:$PATH \
|
| 13 |
+
HF_HOME=/home/user/.cache/huggingface \
|
| 14 |
+
PYTHONUNBUFFERED=1
|
| 15 |
+
|
| 16 |
+
WORKDIR /home/user/app
|
| 17 |
+
|
| 18 |
+
# Pull the app + committed models/*.joblib from GitHub (single source of truth).
|
| 19 |
+
RUN git clone --depth 1 https://github.com/ayushgupta07xx/creatorpulse-india.git .
|
| 20 |
+
|
| 21 |
+
# Core deps (fastapi/uvicorn/sqlalchemy/psycopg2/pandas/numpy/pydantic) from the package,
|
| 22 |
+
# plus only the ML libs the API actually loads at runtime. Deliberately NOT the full
|
| 23 |
+
# [ml] extra β that drags prophet/mlflow/bertopic/optuna, none needed to serve.
|
| 24 |
+
RUN pip install --user --no-cache-dir -e . \
|
| 25 |
+
&& pip install --user --no-cache-dir \
|
| 26 |
+
"sentence-transformers>=3.0" "scikit-learn>=1.5" "xgboost>=2.0"
|
| 27 |
+
|
| 28 |
+
EXPOSE 7860
|
| 29 |
+
CMD ["uvicorn", "apps.api.main:app", "--host", "0.0.0.0", "--port", "7860"]
|
README.md
CHANGED
|
@@ -1,13 +1,27 @@
|
|
| 1 |
---
|
| 2 |
-
title:
|
| 3 |
-
emoji:
|
| 4 |
-
colorFrom:
|
| 5 |
-
colorTo:
|
| 6 |
-
sdk:
|
| 7 |
-
|
| 8 |
-
python_version: '3.13'
|
| 9 |
-
app_file: app.py
|
| 10 |
pinned: false
|
| 11 |
---
|
| 12 |
|
| 13 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
title: CreatorPulse India API
|
| 3 |
+
emoji: π
|
| 4 |
+
colorFrom: indigo
|
| 5 |
+
colorTo: green
|
| 6 |
+
sdk: docker
|
| 7 |
+
app_port: 7860
|
|
|
|
|
|
|
| 8 |
pinned: false
|
| 9 |
---
|
| 10 |
|
| 11 |
+
# CreatorPulse India β API
|
| 12 |
+
|
| 13 |
+
FastAPI backend for CreatorPulse India: creator discovery, channel profiles,
|
| 14 |
+
niche-demand forecasts, and brand β creator matching over a YouTube Data API
|
| 15 |
+
corpus of 12,547 Indian creators.
|
| 16 |
+
|
| 17 |
+
**Endpoints**
|
| 18 |
+
|
| 19 |
+
- `GET /healthz` β liveness
|
| 20 |
+
- `GET /stats` β corpus summary
|
| 21 |
+
- `GET /creators?q=&limit=` β search creators
|
| 22 |
+
- `GET /creators/{channel_id}` β single creator profile
|
| 23 |
+
- `GET /niches/{niche}/forecast` β niche demand forecast
|
| 24 |
+
- `POST /match` β rank creators for a campaign brief (semantic fit, niche overlap,
|
| 25 |
+
fraud risk, budget fit, reach)
|
| 26 |
+
|
| 27 |
+
Built by [Ayush Gupta](https://github.com/ayushgupta07xx).
|