Skip to content

Commit 0bb7ed4

Browse files
committed
Add some docs to OriginalWeightsStorage and fix type hints.
1 parent 86f705b commit 0bb7ed4

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

invokeai/backend/util/original_weights_storage.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,13 @@
88

99

1010
class OriginalWeightsStorage:
11+
"""A class for tracking the original weights of a model for patch/unpatch operations."""
12+
1113
def __init__(self, cached_weights: Optional[Dict[str, torch.Tensor]] = None):
12-
self._weights = {}
13-
self._changed_weights = set()
14+
# The original weights of the model.
15+
self._weights: dict[str, torch.Tensor] = {}
16+
# The keys of the weights that have been changed (via `save()`) during the lifetime of this instance.
17+
self._changed_weights: set[str] = set()
1418
if cached_weights:
1519
self._weights.update(cached_weights)
1620

0 commit comments

Comments
 (0)