fix(llm-server): Phi-4-mini-instruct incompatible with transformers 5.x (tied_weights_keys API change) #11
Labels
No labels
architecture
backlog
enhancement
module:documents
module:hardware
module:manage
module:pipeline
module:voice
priority:backlog
priority:high
priority:medium
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: Circuit-Forge/circuitforge-core#11
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
Phi-4-mini-instruct ships a custom
modeling_phi3.py. Two issues are partially fixed; one remains:SlidingWindowCacheremoved fromtransformers.cache_utils— fixed with try/except stubLossKwargsremoved fromtransformers.utils— fixed with TypedDict stubget_expanded_tied_weights_keys()in transformers 5.x expectstied_mappingas a dict; Phi-3 returns a list — NOT YET FIXED, causes:Impact
Phi-4-mini-instruct cannot load. Qwen2.5-3B-Instruct is sole production model.
Preferred fix
Patch the local
modeling_phi3.pyto overrideget_tied_weights_keys()returning a dict (transformers 5.x format):Files
/Library/Assets/LLM/vllm/models/Phi-4-mini-instruct/modeling_phi3.py— local model codecircuitforge_core/resources/profiles/public/single-gpu-*.yaml— Phi-4-mini removed from candidates for nowRoot cause (updated): transformers 5.x changed
_tied_weights_keysfromlist[str]todict[str, str].get_expanded_tied_weights_keys()reads the attribute directly (self._tied_weights_keys) — not via a method — so a method override does nothing.Fix applied to
/Library/Assets/LLM/vllm/models/Phi-4-mini-instruct/modeling_phi3.py:HF module cache cleared after patching. Model loads and
get_expanded_tied_weights_keys()returns the correct dict. Verified withtransformers5.x. Closes #11.