Skip to content

Commit

Permalink
Fix minimum version for device_map (huggingface#20489)
Browse files Browse the repository at this point in the history
  • Loading branch information
sgugger authored and amyeroberts committed Dec 7, 2022
1 parent 50be707 commit 298c026
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/transformers/modeling_utils.py
Expand Up @@ -1962,8 +1962,8 @@ def from_pretrained(cls, pretrained_model_name_or_path: Optional[Union[str, os.P
# low_cpu_mem_usage requires PyTorch >= 1.9 to have the meta device.
require_version_core("torch>=1.9")
if device_map is not None:
# The max memory utils require PyTorch >= 1.11 to have torch.cuda.mem_get_info.
require_version_core("torch>=1.11")
# The max memory utils require PyTorch >= 1.10 to have torch.cuda.mem_get_info.
require_version_core("torch>=1.10")

if is_deepspeed_zero3_enabled():
raise ValueError(
Expand Down

0 comments on commit 298c026

Please sign in to comment.