Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ python_requires = >=3.7
install_requires =
torch>=1.12
bitsandbytes==0.38.0.post2
accelerate>=0.15.0,<1.0.0
accelerate>=0.16.0,<1.0.0
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

set_module_tensor_to_device's dtype arg didn't exist before 0.16.0

huggingface-hub>=0.11.1,<1.0.0
transformers>=4.25.1,<5.0.0
speedtest-cli==2.1.3
Expand Down
2 changes: 1 addition & 1 deletion src/petals/bloom/from_pretrained.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def load_pretrained_block(
param = state_dict[param_name]
if torch_dtype != "auto" and not str(param.dtype).startswith(("torch.uint", "torch.int", "torch.bool")):
param = param.to(torch_dtype)
set_module_tensor_to_device(block, param_name, "cpu", value=param)
set_module_tensor_to_device(block, param_name, "cpu", value=param, dtype=param.dtype)

logger.info(f"Loaded {converted_model_name_or_path} block {block_index}, {report}")
return block
Expand Down