Skip to content

Fix ModelHook.deinitalize_hook typo (add deinitialize_hook + alias) - #14979

Open
Jacky1128 wants to merge 1 commit into
huggingface:mainfrom
Jacky1128:cursor/fix-deinitialize-hook-d1e6
Open

Jacky1128 wants to merge 1 commit into
huggingface:mainfrom
Jacky1128:cursor/fix-deinitialize-hook-d1e6

Conversation

@Jacky1128

Copy link
Copy Markdown

Summary

Rename the misspelled ModelHook.deinitalize_hook to deinitialize_hook, matching initialize_hook and the existing “deinitialized” docstring wording, while keeping the old name as a compatibility alias.

Changes

  • src/diffusers/hooks/hooks.py: add deinitialize_hook; keep deinitalize_hook as an alias; HookRegistry.remove_hook calls the corrected name
  • src/diffusers/hooks/layerwise_casting.py / sea_cache.py: override deinitialize_hook
  • __init_subclass__ mirrors either spelling onto the other so third-party subclasses that only define the old name still work
  • tests/hooks/test_hooks.py: coverage for the rename/alias behavior

Notes

No FutureWarning on the alias (keeps the diff quiet). This is not covered by the open codespell PR #13842.

Rename deinitalize_hook to deinitialize_hook and keep the old spelling as an alias so existing callers and subclasses still work.
@github-actions github-actions Bot added tests hooks size/M PR with diff < 200 LOC labels Oct 7, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hooks size/M PR with diff < 200 LOC tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant