1
0
mirror of https://github.com/huggingface/diffusers.git synced 2026-01-27 17:22:53 +03:00

Fix typos and inconsistencies (#12204)

Fix typos and test assertions

Co-authored-by: Sayak Paul <spsayakpaul@gmail.com>
This commit is contained in:
Tianqi Tang
2025-08-26 22:58:08 +08:00
committed by GitHub
parent 532f41c999
commit 4b7fe044e3
3 changed files with 6 additions and 4 deletions

View File

@@ -287,7 +287,7 @@ export_to_video(output, "output.mp4", fps=16)
## Reduce memory usage
Recent video models like [`HunyuanVideoPipeline`] and [`WanPipeline`], which have 10B+ parameters, require a lot of memory and it often exceeds the memory availabe on consumer hardware. Diffusers offers several techniques for reducing the memory requirements of these large models.
Recent video models like [`HunyuanVideoPipeline`] and [`WanPipeline`], which have 10B+ parameters, require a lot of memory and it often exceeds the memory available on consumer hardware. Diffusers offers several techniques for reducing the memory requirements of these large models.
> [!TIP]
> Refer to the [Reduce memory usage](../optimization/memory) guide for more details about other memory saving techniques.

View File

@@ -70,10 +70,11 @@ def _is_package_available(pkg_name: str, get_dist_name: bool = False) -> Tuple[b
# Fallback for Python < 3.10
for dist in importlib_metadata.distributions():
_top_level_declared = (dist.read_text("top_level.txt") or "").split()
_infered_opt_names = {
# Infer top-level package names from file structure
_inferred_opt_names = {
f.parts[0] if len(f.parts) > 1 else inspect.getmodulename(f) for f in (dist.files or [])
} - {None}
_top_level_inferred = filter(lambda name: "." not in name, _infered_opt_names)
_top_level_inferred = filter(lambda name: "." not in name, _inferred_opt_names)
for pkg in _top_level_declared or _top_level_inferred:
_package_map[pkg].append(dist.metadata["Name"])
except Exception as _:
@@ -119,7 +120,7 @@ if USE_SAFETENSORS in ENV_VARS_TRUE_AND_AUTO_VALUES:
_safetensors_available, _safetensors_version = _is_package_available("safetensors")
else:
logger.info("Disabling Safetensors because USE_TF is set")
logger.info("Disabling Safetensors because USE_SAFETENSORS is set")
_safetensors_available = False
_onnxruntime_version = "N/A"

View File

@@ -219,6 +219,7 @@ class HookTests(unittest.TestCase):
self.assertAlmostEqual(output1, output2, places=5)
self.assertAlmostEqual(output1, output3, places=5)
self.assertAlmostEqual(output2, output3, places=5)
def test_skip_layer_hook(self):
registry = HookRegistry.check_if_exists_or_initialize(self.model)