Skip to content

Commit 04229f4

Browse files
brandonrisingpsychedelicious
authored andcommitted
Run ruff
1 parent 73a190f commit 04229f4

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

invokeai/app/services/model_install/model_install_base.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,7 @@ def __str__(self) -> str:
131131
return str(self.url)
132132

133133

134-
ModelSource = Annotated[
135-
Union[LocalModelSource, HFModelSource, URLModelSource], Field(discriminator="type")
136-
]
134+
ModelSource = Annotated[Union[LocalModelSource, HFModelSource, URLModelSource], Field(discriminator="type")]
137135

138136
MODEL_SOURCE_TO_TYPE_MAP = {
139137
URLModelSource: ModelSourceType.Url,

invokeai/app/services/shared/sqlite_migrator/sqlite_migrator_common.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ class MigrateCallback(Protocol):
1717
See :class:`Migration` for an example.
1818
"""
1919

20-
def __call__(self, cursor: sqlite3.Cursor) -> None: ...
20+
def __call__(self, cursor: sqlite3.Cursor) -> None:
21+
...
2122

2223

2324
class MigrationError(RuntimeError):

invokeai/backend/training/textual_inversion_training.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -858,9 +858,9 @@ def do_textual_inversion_training(
858858
# Let's make sure we don't update any embedding weights besides the newly added token
859859
index_no_updates = torch.arange(len(tokenizer)) != placeholder_token_id
860860
with torch.no_grad():
861-
accelerator.unwrap_model(text_encoder).get_input_embeddings().weight[index_no_updates] = (
862-
orig_embeds_params[index_no_updates]
863-
)
861+
accelerator.unwrap_model(text_encoder).get_input_embeddings().weight[
862+
index_no_updates
863+
] = orig_embeds_params[index_no_updates]
864864

865865
# Checks if the accelerator has performed an optimization step behind the scenes
866866
if accelerator.sync_gradients:

0 commit comments

Comments
 (0)