Skip to content

fix: honor dtype/device in load_state_dict_hf - #993

Open
Chessing234 wants to merge 1 commit into
state-spaces:mainfrom
Chessing234:fix/load-state-dict-hf-dtype-device
Open

fix: honor dtype/device in load_state_dict_hf#993
Chessing234 wants to merge 1 commit into
state-spaces:mainfrom
Chessing234:fix/load-state-dict-hf-dtype-device

Conversation

@Chessing234

Copy link
Copy Markdown
Contributor

Summary

  • Early return torch.load(...) made the dtype/device conversion unreachable.
  • Assign state_dict then convert before returning.

Test plan

  • load_state_dict_hf(..., dtype=torch.float16) returns fp16 tensors

Made with Cursor

Early return skipped the conversion block so dtype= and device= were ignored.
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