Skip to content

cache model weights under versioned slug and purge stale ones#357

Merged
MateoLostanlen merged 1 commit intodevelopfrom
fix_model_update
Apr 21, 2026
Merged

cache model weights under versioned slug and purge stale ones#357
MateoLostanlen merged 1 commit intodevelopfrom
fix_model_update

Conversation

@MateoLostanlen
Copy link
Copy Markdown
Member

Before this change, bumping MODEL_REPO_ID (e.g. plucky-pelican_v7.0.0 → v7.1.0) had no effect on existing deployments: the local archive name (ncnn_cpu.tar.gz) and extract dir (ncnn_cpu/)
are unversioned, so the is_file() / is_dir() guards skipped the re-download and NCNN loaded the old weights.

Now cached weights live under data/models/{MODEL_SLUG}/ (slug derived from MODEL_REPO_ID). A version bump lands in a fresh path, and on download we purge any other slug plus the pre-slug
flat files to reclaim disk on edge devices

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 21, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 73.85%. Comparing base (f731dd1) to head (a79226e).
⚠️ Report is 2 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #357      +/-   ##
===========================================
- Coverage    73.93%   73.85%   -0.09%     
===========================================
  Files            6        6              
  Lines          633      631       -2     
===========================================
- Hits           468      466       -2     
  Misses         165      165              
Flag Coverage Δ
unittests 73.85% <ø> (-0.09%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Member

@fe51 fe51 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch and quick fix ! Thanks !

@MateoLostanlen MateoLostanlen merged commit 1bc58f6 into develop Apr 21, 2026
10 of 12 checks passed
@MateoLostanlen MateoLostanlen deleted the fix_model_update branch April 21, 2026 16:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants