Skip to content

Fix load saved lora_config.json when loading LoRA weights#329

Open
zhuxiaoxuhit wants to merge 1 commit into
OpenBMB:mainfrom
zhuxiaoxuhit:fix/lora-config-autoload
Open

Fix load saved lora_config.json when loading LoRA weights#329
zhuxiaoxuhit wants to merge 1 commit into
OpenBMB:mainfrom
zhuxiaoxuhit:fix/lora-config-autoload

Conversation

@zhuxiaoxuhit
Copy link
Copy Markdown

Problem

VoxCPM.from_pretrained(lora_weights_path=...) builds a default r=8 LoRAConfig
and crashes (shape mismatch) for LoRA checkpoints trained with other ranks —
e.g. the r=32 produced by conf/voxcpm_v2/voxcpm_finetune_lora.yaml.

Fix

When lora_weights_path is a checkpoint dir containing lora_config.json (saved
by the training script), load LoRAConfig from it so r/alpha match; otherwise
keep the previous default.

Test

from_pretrained(lora_weights_path=) now loads cleanly
("Loaded 384 LoRA parameters, skipped 0") instead of crashing.

from_pretrained(lora_weights_path=...) built a default r=8 LoRAConfig and crashed for checkpoints trained with other ranks (e.g. r=32). Load the checkpoint's lora_config.json so r/alpha match; fall back to the default.
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.

1 participant