Skip to content

Commit 7ddc4a1

Browse files
Fix custom releases (#3708)
* Fix custom releases * make style
1 parent cd9d091 commit 7ddc4a1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/diffusers/utils/dynamic_modules_utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@
2121
import re
2222
import shutil
2323
import sys
24-
from distutils.version import StrictVersion
2524
from pathlib import Path
2625
from typing import Dict, Optional, Union
2726
from urllib import request
2827

2928
from huggingface_hub import HfFolder, cached_download, hf_hub_download, model_info
29+
from packaging import version
3030

3131
from .. import __version__
3232
from . import DIFFUSERS_DYNAMIC_MODULE_NAME, HF_MODULES_CACHE, logging
@@ -43,7 +43,7 @@
4343
def get_diffusers_versions():
4444
url = "https://pypi.org/pypi/diffusers/json"
4545
releases = json.loads(request.urlopen(url).read())["releases"].keys()
46-
return sorted(releases, key=StrictVersion)
46+
return sorted(releases, key=lambda x: version.Version(x))
4747

4848

4949
def init_hf_modules():

0 commit comments

Comments
 (0)