Skip to content

Conversation

@stephantul
Copy link
Contributor

@stephantul stephantul commented Sep 9, 2025

This PR adds much faster model loading by directly loading from cache if a model is cached, if force_download is set to true during loading

Timings when loading potion-base-8m

  • Before: 1.27 s ± 72.5 ms per loop
  • Now: 37.3 ms ± 335 µs per loop

This speed is only enabled when setting force_download to False. It is true by default for backwards compatibility and download tracking

Mention for #275

@stephantul stephantul requested a review from Pringled September 9, 2025 08:59
@codecov
Copy link

codecov bot commented Sep 9, 2025

Codecov Report

❌ Patch coverage is 66.66667% with 9 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
model2vec/hf_utils.py 62.50% 9 Missing ⚠️
Files with missing lines Coverage Δ
model2vec/distill/inference.py 97.46% <100.00%> (ø)
model2vec/model.py 93.70% <100.00%> (-0.30%) ⬇️
model2vec/utils.py 90.74% <ø> (-1.80%) ⬇️
model2vec/hf_utils.py 76.23% <62.50%> (+1.23%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
@stephantul stephantul merged commit 13095c9 into main Sep 9, 2025
5 of 6 checks passed
@stephantul stephantul deleted the disable-ssl-and-readme branch September 9, 2025 10:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants