Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
renzhc
diffusers_dcu
Commits
78c2fdc5
"git@developer.sourcefind.cn:OpenDAS/mmcv.git" did not exist on "9d1436fb6c62b6858db367c937d27c0ba7b51459"
Unverified
Commit
78c2fdc5
authored
Apr 02, 2025
by
hlky
Committed by
GitHub
Apr 02, 2025
Browse files
SchedulerMixin from_pretrained and ConfigMixin Self type annotation (#11192)
parent
54dac3a8
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
2 deletions
+6
-2
src/diffusers/configuration_utils.py
src/diffusers/configuration_utils.py
+4
-1
src/diffusers/schedulers/scheduling_utils.py
src/diffusers/schedulers/scheduling_utils.py
+2
-1
No files found.
src/diffusers/configuration_utils.py
View file @
78c2fdc5
...
@@ -35,6 +35,7 @@ from huggingface_hub.utils import (
...
@@ -35,6 +35,7 @@ from huggingface_hub.utils import (
validate_hf_hub_args
,
validate_hf_hub_args
,
)
)
from
requests
import
HTTPError
from
requests
import
HTTPError
from
typing_extensions
import
Self
from
.
import
__version__
from
.
import
__version__
from
.utils
import
(
from
.utils
import
(
...
@@ -185,7 +186,9 @@ class ConfigMixin:
...
@@ -185,7 +186,9 @@ class ConfigMixin:
)
)
@
classmethod
@
classmethod
def
from_config
(
cls
,
config
:
Union
[
FrozenDict
,
Dict
[
str
,
Any
]]
=
None
,
return_unused_kwargs
=
False
,
**
kwargs
):
def
from_config
(
cls
,
config
:
Union
[
FrozenDict
,
Dict
[
str
,
Any
]]
=
None
,
return_unused_kwargs
=
False
,
**
kwargs
)
->
Union
[
Self
,
Tuple
[
Self
,
Dict
[
str
,
Any
]]]:
r
"""
r
"""
Instantiate a Python class from a config dictionary.
Instantiate a Python class from a config dictionary.
...
...
src/diffusers/schedulers/scheduling_utils.py
View file @
78c2fdc5
...
@@ -19,6 +19,7 @@ from typing import Optional, Union
...
@@ -19,6 +19,7 @@ from typing import Optional, Union
import
torch
import
torch
from
huggingface_hub.utils
import
validate_hf_hub_args
from
huggingface_hub.utils
import
validate_hf_hub_args
from
typing_extensions
import
Self
from
..utils
import
BaseOutput
,
PushToHubMixin
from
..utils
import
BaseOutput
,
PushToHubMixin
...
@@ -99,7 +100,7 @@ class SchedulerMixin(PushToHubMixin):
...
@@ -99,7 +100,7 @@ class SchedulerMixin(PushToHubMixin):
subfolder
:
Optional
[
str
]
=
None
,
subfolder
:
Optional
[
str
]
=
None
,
return_unused_kwargs
=
False
,
return_unused_kwargs
=
False
,
**
kwargs
,
**
kwargs
,
):
)
->
Self
:
r
"""
r
"""
Instantiate a scheduler from a pre-defined JSON configuration file in a local directory or Hub repository.
Instantiate a scheduler from a pre-defined JSON configuration file in a local directory or Hub repository.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment