Skip to content
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

[2/N] Add type annotations to ModelPatcher fields #3573

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

huchenlei
Copy link
Collaborator

Based on #3564

This PR adds type annotations to ModelPatcher's fields.

This PR also makes ModelPatcher generic so that we can have type annotations like ModelPatcher[Unet], ModelPatcher[VAE] for easier code understanding.

@huchenlei huchenlei changed the title Patcher type1 [2/N] Add type annotations to ModelPatcher fields May 25, 2024
self.model_lowvram = False
self.lowvram_patch_counter = 0
self.patches_uuid = uuid.uuid4()
self.load_device: torch.device = load_device
Copy link
Contributor

@shawnington shawnington May 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not just type hint load_device and offload_device in the init input only? Python isn't a typed language, and the variable are descriptive of what they are doing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants