Skip to content

Fix typos and inconsistencies #12204

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/source/en/using-diffusers/text-img2vid.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
7 changes: 4 additions & 3 deletions src/diffusers/utils/import_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 _:
Expand Down Expand Up @@ -119,7 +120,7 @@ def _is_package_available(pkg_name: str, get_dist_name: bool = False) -> Tuple[b
_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"
Expand Down
1 change: 1 addition & 0 deletions tests/hooks/test_hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ def test_inference(self):

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)
Expand Down