[v1] Support meta loading for full and free (#10236)

This commit is contained in:
jiaqiw09
2026-03-05 23:15:27 +08:00
committed by GitHub
parent 3061f48d55
commit 0ee1c42c2b
3 changed files with 150 additions and 0 deletions

View File

@@ -150,6 +150,9 @@ def load_adapter(model: HFModel, adapter_name_or_path: Union[list[str], str], is
@PeftPlugin("lora").register()
def get_lora_model(model: HFModel, config: LoraConfigDict, is_train: bool = False) -> HFModel:
if model.device.type == "meta":
raise ValueError("Currently lora stage does not support loading model by meta.")
adapter_name_or_path = config.get("adapter_name_or_path")
if adapter_name_or_path: