Skip to content

AutoModel.from_pretrained without accelerate raises a NameError because init_empty_weights is not available #37311

@LoicGrobol

Description

@LoicGrobol

d1b92369ca193 introduced a call to init_empty_weights that leads to an error if accelerate is not installed. This should be guarded by a condition that accelerate is available (one already guards the import, but not the actual call).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions