Skip to content

Commit 9659863

Browse files
committed
Revert an accidental commit
This reverts commit 679c77f.
1 parent 80be074 commit 9659863

File tree

3 files changed

+3
-20
lines changed

3 files changed

+3
-20
lines changed

src/diffusers/modeling_flax_utils.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
from huggingface_hub.utils import EntryNotFoundError, RepositoryNotFoundError, RevisionNotFoundError
2828
from requests import HTTPError
2929

30-
from . import __version__, is_torch_available
30+
from . import is_torch_available
3131
from .modeling_flax_pytorch_utils import convert_pytorch_state_dict_to_flax
3232
from .utils import (
3333
CONFIG_NAME,
@@ -289,12 +289,7 @@ def from_pretrained(
289289
from_auto_class = kwargs.pop("_from_auto", False)
290290
subfolder = kwargs.pop("subfolder", None)
291291

292-
user_agent = {
293-
"diffusers": __version__,
294-
"file_type": "model",
295-
"framework": "flax",
296-
"from_auto_class": from_auto_class,
297-
}
292+
user_agent = {"file_type": "model", "framework": "flax", "from_auto_class": from_auto_class}
298293

299294
# Load config if we don't provide a configuration
300295
config_path = config if config is not None else pretrained_model_name_or_path

src/diffusers/modeling_utils.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
from huggingface_hub.utils import EntryNotFoundError, RepositoryNotFoundError, RevisionNotFoundError
2727
from requests import HTTPError
2828

29-
from . import __version__
3029
from .utils import CONFIG_NAME, DIFFUSERS_CACHE, HUGGINGFACE_CO_RESOLVE_ENDPOINT, WEIGHTS_NAME, logging
3130

3231

@@ -298,12 +297,7 @@ def from_pretrained(cls, pretrained_model_name_or_path: Optional[Union[str, os.P
298297
subfolder = kwargs.pop("subfolder", None)
299298
device_map = kwargs.pop("device_map", None)
300299

301-
user_agent = {
302-
"diffusers": __version__,
303-
"file_type": "model",
304-
"framework": "pytorch",
305-
"from_auto_class": from_auto_class,
306-
}
300+
user_agent = {"file_type": "model", "framework": "pytorch", "from_auto_class": from_auto_class}
307301

308302
# Load config if we don't provide a configuration
309303
config_path = pretrained_model_name_or_path

src/diffusers/pipeline_utils.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
from PIL import Image
3030
from tqdm.auto import tqdm
3131

32-
from . import __version__
3332
from .configuration_utils import ConfigMixin
3433
from .dynamic_modules_utils import get_class_from_dynamic_module
3534
from .schedulers.scheduling_utils import SCHEDULER_CONFIG_NAME
@@ -374,10 +373,6 @@ def from_pretrained(cls, pretrained_model_name_or_path: Optional[Union[str, os.P
374373
if custom_pipeline is not None:
375374
allow_patterns += [CUSTOM_PIPELINE_FILE_NAME]
376375

377-
user_agent = {"diffusers": __version__, "pipeline_class": config_dict["_class_name"]}
378-
if custom_pipeline is not None:
379-
user_agent["custom_pipeline"] = custom_pipeline
380-
381376
# download all allow_patterns
382377
cached_folder = snapshot_download(
383378
pretrained_model_name_or_path,
@@ -388,7 +383,6 @@ def from_pretrained(cls, pretrained_model_name_or_path: Optional[Union[str, os.P
388383
use_auth_token=use_auth_token,
389384
revision=revision,
390385
allow_patterns=allow_patterns,
391-
user_agent=user_agent,
392386
)
393387
else:
394388
cached_folder = pretrained_model_name_or_path

0 commit comments

Comments
 (0)