Skip to content

Commit 8f86e56

Browse files
committed
Update pipeline_utils.py
Added Self in from_pretrained method so inference will correctly recognize pipeline
1 parent f63d322 commit 8f86e56

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/diffusers/pipelines/pipeline_utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
import sys
2323
from dataclasses import dataclass
2424
from pathlib import Path
25-
from typing import Any, Callable, Dict, List, Optional, Union, get_args, get_origin
25+
from typing import Any, Callable, Dict, List, Optional, Self, Union, get_args, get_origin
2626

2727
import numpy as np
2828
import PIL.Image
@@ -513,7 +513,7 @@ def dtype(self) -> torch.dtype:
513513

514514
@classmethod
515515
@validate_hf_hub_args
516-
def from_pretrained(cls, pretrained_model_name_or_path: Optional[Union[str, os.PathLike]], **kwargs):
516+
def from_pretrained(cls, pretrained_model_name_or_path: Optional[Union[str, os.PathLike]], **kwargs) -> Self:
517517
r"""
518518
Instantiate a PyTorch diffusion pipeline from pretrained pipeline weights.
519519

0 commit comments

Comments
 (0)