Skip to content

Commit d12e9eb

Browse files
[Docs] Add subfolder docs (#500)
* [Docs] Add subfolder docs * Apply suggestions from code review Co-authored-by: Pedro Cuenca <[email protected]> * up Co-authored-by: Pedro Cuenca <[email protected]>
1 parent da7e399 commit d12e9eb

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

src/diffusers/configuration_utils.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,10 +134,9 @@ def from_config(cls, pretrained_model_name_or_path: Union[str, os.PathLike], ret
134134
The specific model version to use. It can be a branch name, a tag name, or a commit id, since we use a
135135
git-based system for storing models and other artifacts on huggingface.co, so `revision` can be any
136136
identifier allowed by git.
137-
mirror (`str`, *optional*):
138-
Mirror source to accelerate downloads in China. If you are from China and have an accessibility
139-
problem, you can set this option to resolve it. Note that we do not guarantee the timeliness or safety.
140-
Please refer to the mirror site for more information.
137+
subfolder (`str`, *optional*, defaults to `""`):
138+
In case the relevant files are located inside a subfolder of the model repo (either remote in
139+
huggingface.co or downloaded locally), you can specify the folder name here.
141140
142141
<Tip>
143142
@@ -175,6 +174,7 @@ def get_config_dict(
175174
use_auth_token = kwargs.pop("use_auth_token", None)
176175
local_files_only = kwargs.pop("local_files_only", False)
177176
revision = kwargs.pop("revision", None)
177+
_ = kwargs.pop("mirror", None)
178178
subfolder = kwargs.pop("subfolder", None)
179179

180180
user_agent = {"file_type": "config"}

src/diffusers/modeling_utils.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,10 @@ def from_pretrained(cls, pretrained_model_name_or_path: Optional[Union[str, os.P
228228
The specific model version to use. It can be a branch name, a tag name, or a commit id, since we use a
229229
git-based system for storing models and other artifacts on huggingface.co, so `revision` can be any
230230
identifier allowed by git.
231+
subfolder (`str`, *optional*, defaults to `""`):
232+
In case the relevant files are located inside a subfolder of the model repo (either remote in
233+
huggingface.co or downloaded locally), you can specify the folder name here.
234+
231235
mirror (`str`, *optional*):
232236
Mirror source to accelerate downloads in China. If you are from China and have an accessibility
233237
problem, you can set this option to resolve it. Note that we do not guarantee the timeliness or safety.

0 commit comments

Comments
 (0)