Skip to content

Commit 7ab2011

Browse files
authored
Fix AutoModel typing Import Error (#13178)
Fix typing import by converting to Python 3.9+ style type hint
1 parent 4890e9b commit 7ab2011

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/diffusers/models/auto_model.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,7 @@ def __init__(self, *args, **kwargs):
3636
)
3737

3838
@classmethod
39-
def from_config(
40-
cls, pretrained_model_name_or_path_or_dict: Optional[Union[str, os.PathLike, dict]] = None, **kwargs
41-
):
39+
def from_config(cls, pretrained_model_name_or_path_or_dict: str | os.PathLike | dict | None = None, **kwargs):
4240
r"""
4341
Instantiate a model from a config dictionary or a pretrained model configuration file with random weights (no
4442
pretrained weights are loaded).

0 commit comments

Comments
 (0)