diffusers-dashboard / README.md
sayakpaul's picture
sayakpaul HF Staff
Refresh Diffusers dashboard snapshot
557614b verified
|
Raw History Blame Contribute Delete
5.51 kB
---
title: Diffusers Project Pulse
emoji: 🎨
colorFrom: purple
colorTo: pink
sdk: gradio
sdk_version: 5.25.0
app_file: app.py
python_version: 3.11
---
# Diffusers Project Pulse
A Diffusers adoption dashboard based on the layout and design of [LeRobot Project Pulse](https://github.com/huggingface/lerobot-dashboard). It covers Hugging Face Hub models tagged with the `diffusers` library, GitHub repository activity, and PyPI package downloads. It has no dataset collection or dataset views.
The **Overview** pairs growth cards with a publication chart and a model-task mix chart. **Models** has ranked models and contributors plus four growth charts. **GitHub & Community** shows star history, daily PyPI downloads, contributor growth, top contributors, development activity, and package adoption. **Organizations** follows LeRobot's curated-account approach for companies and research labs that publish Diffusers models.
The collector writes one JSON snapshot. The Gradio app reads that file at startup, so visitors share consistent values and do not trigger API requests. If a source fails during refresh, its previous data is kept and marked **stale**; a source without previous data is marked **unavailable**. Trend charts grow from successful daily snapshots.
## Run locally
```bash
cd diffusers-dashboard
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
python -m scripts.refresh_snapshot
python app.py
```
Open <http://localhost:7860>. The app also starts without a snapshot and explains how to collect one.
Optional environment variables:
- `DASHBOARD_HF_TOKEN` (or `HF_TOKEN`) for Hub API access.
- `DASHBOARD_GITHUB_TOKEN` for a higher GitHub API rate limit and complete API-based contributor history.
Tokens are read only by the collector; they are never written into the snapshot. No token is required for public data. To update a running local app, rerun the collector and restart the app.
## What the figures mean
- **Hub models** are public models returned by `HfApi.list_models(filter="diffusers")`. A model needs the Diffusers library tag to appear. The configured scan limit is 200,000; if reached, the dashboard marks totals and rankings as partial.
- **Model downloads** sum each matching model's Hub downloads counter over the last 30 days. This is not a count of distinct users and may overlap across models.
- **Publishers** are account names from model repository IDs, not a verified list of institutions.
- **Organizations** are a curated subset of verified Hub organization accounts. Their kind and country are reviewed manually, with the review date shown in the tab. Model counts and download totals come only from Diffusers-tagged models in the current snapshot.
- **Model percentages** compare the current tagged model inventory with the cohort published before the last 90 days. The label says “models published in the past 3 months” because downloads and likes on newly published models are a cohort contribution, not an observed change in those counters over time.
- **GitHub star percentages** use the aggregate history when available; issue and PR percentages use saved snapshots. The actual comparison period is shown. Contributor percentages use the full commit-author history when available.
- **GitHub star history** is backfilled for up to two years from GitHub's public aggregate weekly and daily star counts. It does not list stargazers or require a token. If the aggregate endpoint is unavailable, the chart grows from scheduled snapshots. GitHub does not guarantee that its week and day boundaries align with UTC. Contributor growth uses a complete local Diffusers checkout if one is available beside this project; set `DASHBOARD_DIFFUSERS_GIT_PATH` to use another checkout. In scheduled runs with a GitHub token, it walks the full default-branch commit history instead. Recent commits extend the local history, and the rolling 30-day activity line is omitted if an API-only scan is incomplete. Git commit authors and GitHub-linked accounts have different counts; the chart labels them accordingly.
- **PyPI percentages** compare equal-length daily download windows 90 days apart, using the mirror-excluded daily series. The latest day, week, and month figures use the same series when it is available.
- **Trends** start on the first day this dashboard records a snapshot. Publication charts use Hub repository creation dates and are separate from snapshot history.
## Deployment
The repo is ready to run as a Gradio Space. Create a Space, then set the GitHub Actions variable `HF_SPACE_REPO` to its `owner/name` and the secret `HF_TOKEN` to a token with write access to that Space. The included workflow runs every six hours and can also be started manually. It restores the previous snapshot from the Space, refreshes all sources, and publishes the app with the new snapshot. The Space retains the trend history across workflow runs. No destination or credential is preconfigured.
For a one-time local publish after the Space exists, set `HF_SPACE_REPO` and `HF_TOKEN`, then run `python -m scripts.space_snapshot publish`. Publishing writes to the configured Space.
The adapted visual stylesheet in `dashboard/reference_style.css` comes from the Apache-2.0-licensed LeRobot dashboard; its license is included as `LICENSE-lerobot-dashboard`.
Install `requirements-dev.txt` and run `python -m pytest tests` to check aggregation, trend arithmetic, chart generation, stale source handling, and HTML escaping.