temp hotfix for rocm torch

This commit is contained in:
cmdr2 2024-06-13 14:05:11 +05:30
parent fcdc3f2dd0
commit d062c2149a

View File

@ -141,7 +141,6 @@ def update_modules():
else: else:
sdkit_version = version_str_to_tuple(sdkit_version_str) sdkit_version = version_str_to_tuple(sdkit_version_str)
legacy_sdkit_version = version_str_to_tuple(legacy_sdkit_version_str) legacy_sdkit_version = version_str_to_tuple(legacy_sdkit_version_str)
torch_version = version_str_to_tuple(version("torch"))
if sdkit_version[:3] <= legacy_sdkit_version[:3]: # and torch_version < (0, 13): if sdkit_version[:3] <= legacy_sdkit_version[:3]: # and torch_version < (0, 13):
# stick to diffusers 0.21.4, since it preserves torch 0.11+ compatibility. # stick to diffusers 0.21.4, since it preserves torch 0.11+ compatibility.
@ -152,6 +151,7 @@ def update_modules():
install_pkg_if_necessary("sdkit", legacy_sdkit_version_str) install_pkg_if_necessary("sdkit", legacy_sdkit_version_str)
install_pkg_if_necessary("diffusers", legacy_diffusers_version_str) install_pkg_if_necessary("diffusers", legacy_diffusers_version_str)
else: else:
torch_version = version_str_to_tuple(version("torch"))
if torch_version < (1, 13): if torch_version < (1, 13):
# install the gpu-compatible torch (if necessary), instead of the default CPU-only one # install the gpu-compatible torch (if necessary), instead of the default CPU-only one
# from the diffusers dependency chain # from the diffusers dependency chain