unsloth/studio/backend/core/inference
Roland Tannous 737017a511 fix(studio): lazy-import extract_model_size_b in llama_cpp to fix transformers 5.x version switch
PR #4769 (e4d14992) added a module-level `from utils.models import
extract_model_size_b` to llama_cpp.py.  Since core/inference/__init__.py
eagerly imports llama_cpp, the spawn subprocess now hits:

  core.inference.__init__  →  llama_cpp  →  utils.models  →
  model_config (line 8: `from transformers import AutoConfig`)

…before _activate_transformers_version() has a chance to prepend
.venv_t5/ to sys.path.  Python caches transformers 4.57.6 in
sys.modules, and no subsequent sys.path change can override it.

Fix: replace the eager import with a thin wrapper that defers the
import to first call.  This breaks the transitive chain so
transformers is not loaded until after version activation.
2026-04-02 21:42:56 +00:00
..
__init__.py Final cleanup 2026-03-12 18:28:04 +00:00
_html_to_md.py fix: studio web search SSL failures and empty page content (#4754) 2026-04-01 06:12:02 -07:00
audio_codecs.py studio: per-model inference defaults, GGUF slider fix, reasoning toggle (#4325) 2026-03-16 06:37:55 -07:00
defaults.py UI Changes (#4782) 2026-04-02 08:05:55 -07:00
inference.py [studio] multi gpu: revert to balanced for inference. (#4698) 2026-03-31 01:24:41 -07:00
llama_cpp.py fix(studio): lazy-import extract_model_size_b in llama_cpp to fix transformers 5.x version switch 2026-04-02 21:42:56 +00:00
orchestrator.py fix(studio): prioritize curated defaults over HF download ranking in Recommended (#4792) 2026-04-02 10:46:53 -07:00
tools.py feat(studio): display images from Python tool execution in chat UI (#4778) 2026-04-02 05:08:16 -07:00
worker.py fix: auto-retry stalled HF downloads with HF_HUB_DISABLE_XET=1 (#4712) 2026-03-31 03:00:46 -07:00