Skip to content

Commit 04f2f55

Browse files
committed
Fix style for hpu support update
Signed-off-by: Daniel Socek <[email protected]>
1 parent baf75db commit 04f2f55

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/diffusers/pipelines/pipeline_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,7 @@ def module_is_offloaded(module):
449449
# Enable generic support for Intel Gaudi accelerator using GPU/HPU migration
450450
if kwargs.pop("hpu_migration", True) and is_hpu_available():
451451
os.environ["PT_HPU_MAX_COMPOUND_OP_SIZE"] = "1"
452-
logger.debug('Environment variable set: PT_HPU_MAX_COMPOUND_OP_SIZE=1')
452+
logger.debug("Environment variable set: PT_HPU_MAX_COMPOUND_OP_SIZE=1")
453453

454454
module_names, _ = self._get_signature_keys(self)
455455
modules = [getattr(self, n, None) for n in module_names]

src/diffusers/utils/import_utils.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,7 @@ def is_optimum_quanto_available():
335335
def is_timm_available():
336336
return _timm_available
337337

338+
338339
def is_hpu_available():
339340
if (
340341
importlib.util.find_spec("habana_frameworks") is None
@@ -343,12 +344,14 @@ def is_hpu_available():
343344
return False
344345

345346
os.environ["PT_HPU_GPU_MIGRATION"] = "1"
346-
logger.debug('Environment variable set: PT_HPU_GPU_MIGRATION=1')
347+
logger.debug("Environment variable set: PT_HPU_GPU_MIGRATION=1")
347348

348-
import torch
349349
import habana_frameworks.torch # noqa: F401
350+
import torch
351+
350352
return hasattr(torch, "hpu") and torch.hpu.is_available()
351353

354+
352355
# docstyle-ignore
353356
FLAX_IMPORT_ERROR = """
354357
{0} requires the FLAX library but it was not found in your environment. Checkout the instructions on the

0 commit comments

Comments
 (0)