Support LoRA encoder (#695)

* lora_encoder
This commit is contained in:
Zhongjie Duan
2025-07-19 20:44:03 +08:00
committed by GitHub
parent d19fcc8c04
commit 1384de0353
7 changed files with 294 additions and 2 deletions

View File

@@ -71,7 +71,7 @@ def load_state_dict(file_path, torch_dtype=None, device="cpu"):
def load_state_dict_from_safetensors(file_path, torch_dtype=None, device="cpu"):
state_dict = {}
with safe_open(file_path, framework="pt", device=device) as f:
with safe_open(file_path, framework="pt", device=str(device)) as f:
for k in f.keys():
state_dict[k] = f.get_tensor(k)
if torch_dtype is not None: