Skip to content

Pipeline __call__ functions are not in inference mode decorators → OOM when used externally from Python #152

@emirks

Description

@emirks

If you use the pipelines from your own script (not the CLI), __call__ isn’t under torch.inference_mode(). The text encoder keeps ~37 GB of graph/activations, so after you drop it and load the transformer you OOM.

Fix: Either put @torch.inference_mode() to respective places (i.e. on each pipeline’s __call__), or mention in the README that callers should wrap pipeline calls in torch.inference_mode().

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