mirror of
https://github.com/huggingface/diffusers.git
synced 2026-01-27 17:22:53 +03:00
apply_forward_hook simply returns if no accelerate (#2387)
Signed-off-by: daquexian <daquexian566@gmail.com>
This commit is contained in:
@@ -34,6 +34,8 @@ def apply_forward_hook(method):
|
||||
|
||||
:param method: The method to decorate. This method should be a method of a PyTorch module.
|
||||
"""
|
||||
if not is_accelerate_available():
|
||||
return method
|
||||
accelerate_version = version.parse(accelerate.__version__).base_version
|
||||
if version.parse(accelerate_version) < version.parse("0.17.0"):
|
||||
return method
|
||||
|
||||
Reference in New Issue
Block a user