Skip to content

Conversation

@jazzhaiku
Copy link
Contributor

@jazzhaiku jazzhaiku commented Mar 17, 2025

Summary

Problem
We want to have automated tests for model classification/probing, but model files are too large to include in the source.

Proposed Solution
Classification/probing only requires metadata (key names, tensor shapes), not weights.
This PR introduces "stripped" models - lightweight versions that retains only essential metadata.

  • Added script to strip models
  • Added stripped models to automated tests

Model size before and after "stripping":

LLaVA Onevision Qwen2 0.5b-ov-hf before: 1.8 GB, after: 11.6 MB
text_encoder before: 246.1 MB, after: 35.6 kB
llava-onevision-qwen2-7b-si-hf before: 16.1 GB, after: 11.7 MB
RealESRGAN_x2plus.pth before: 67.1 MB, after: 143.0 kB
IP Adapter SD1 before: 2.5 GB, after: 94.9 kB
Hard Edge Detection (canny) before: 722.6 MB, after: 63.6 kB
Lineart before: 722.6 MB, after: 63.6 kB
Segmentation Map before: 722.6 MB, after: 63.6 kB
EasyNegative before: 24.7 kB, after: 151 Bytes
Face Reference (IP Adapter Plus Face) before: 98.2 MB, after: 13.7 kB
Standard Reference (IP Adapter) before: 44.6 MB, after: 6.0 kB
shinkai_makoto_offset before: 151.1 MB, after: 160.0 kB
thickline_fp16 before: 151.1 MB, after: 160.0 kB
Alien Style before: 228.5 MB, after: 582.6 kB
Noodles Style before: 228.5 MB, after: 582.6 kB
Juggernaut XL v9 before: 6.9 GB, after: 3.7 MB
dreamshaper-8 before: 168.9 MB, after: 1.6 MB

Related Issues / Discussions

QA Instructions

Merge Plan

Checklist

  • The PR has a short but descriptive title, suitable for a changelog
  • Tests added / updated (if applicable)
  • Documentation added / updated (if applicable)
  • Updated What's New copy (if doing a release after this PR)

@github-actions github-actions bot added python PRs that change python files backend PRs that change backend files python-tests PRs that change python tests labels Mar 17, 2025
@github-actions github-actions bot added Root python-deps PRs that change python dependencies labels Mar 17, 2025
@jazzhaiku jazzhaiku marked this pull request as ready for review March 17, 2025 04:52
@jazzhaiku jazzhaiku marked this pull request as draft March 17, 2025 21:57
@jazzhaiku jazzhaiku marked this pull request as ready for review March 17, 2025 22:22
Base automatically changed from model-classification-api to main March 18, 2025 04:25
@psychedelicious psychedelicious merged commit feed44b into main Mar 18, 2025
15 checks passed
@psychedelicious psychedelicious deleted the stripped-models branch March 18, 2025 21:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend PRs that change backend files python PRs that change python files python-deps PRs that change python dependencies python-tests PRs that change python tests Root

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants