mirror of
https://github.com/hiyouga/LLaMA-Factory.git
synced 2025-12-16 20:00:36 +08:00
fix #5295
This commit is contained in:
@@ -75,8 +75,7 @@ def fix_valuehead_checkpoint(
|
||||
state_dict: Dict[str, torch.Tensor] = torch.load(path_to_checkpoint, map_location="cpu")
|
||||
|
||||
os.remove(path_to_checkpoint)
|
||||
decoder_state_dict = {}
|
||||
v_head_state_dict = {}
|
||||
decoder_state_dict, v_head_state_dict = {}, {}
|
||||
for name, param in state_dict.items():
|
||||
if name.startswith("v_head."):
|
||||
v_head_state_dict[name] = param
|
||||
|
||||
Reference in New Issue
Block a user