Skip to content

Commit 84bad4e

Browse files
pre-commit-ci[bot]neggles
authored andcommitted
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent f6588b0 commit 84bad4e

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

src/animatediff/models/motion_module.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,9 @@ def forward(
128128
encoder_hidden_states: Optional[Tensor] = None,
129129
attention_mask: Optional[Tensor] = None,
130130
):
131-
assert (
132-
hidden_states.dim() == 5
133-
), f"Expected hidden_states to have ndim=5, but got ndim={hidden_states.dim()}."
131+
assert hidden_states.dim() == 5, (
132+
f"Expected hidden_states to have ndim=5, but got ndim={hidden_states.dim()}."
133+
)
134134
video_length = hidden_states.shape[2]
135135
hidden_states = rearrange(hidden_states, "b c f h w -> (b f) c h w")
136136

src/animatediff/settings.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,11 @@ def __call__(self, settings: BaseSettings) -> Dict[str, Any]: # noqa C901
4343
merged_config = dict() # create an empty dict to merge configs into
4444
for idx, path in enumerate(self.json_config_path):
4545
if path.exists() and path.is_file(): # check if the path exists and is a file
46-
logger.debug(f"{classname}: loading config #{idx+1} from {path}")
46+
logger.debug(f"{classname}: loading config #{idx + 1} from {path}")
4747
merged_config.update(json.loads(path.read_text(encoding=encoding)))
48-
logger.debug(f"{classname}: config state #{idx+1}: {merged_config}")
48+
logger.debug(f"{classname}: config state #{idx + 1}: {merged_config}")
4949
else:
50-
raise FileNotFoundError(f"{classname}: config #{idx+1} at {path} not found or not a file")
50+
raise FileNotFoundError(f"{classname}: config #{idx + 1} at {path} not found or not a file")
5151

5252
logger.debug(f"{classname}: loaded config: {merged_config}")
5353
return merged_config # return the merged config

src/animatediff/utils/device.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
def device_info_str(device: torch.device) -> str:
1212
device_info = torch.cuda.get_device_properties(device)
1313
return (
14-
f"{device_info.name} {ceil(device_info.total_memory / 1024 ** 3)}GB, "
14+
f"{device_info.name} {ceil(device_info.total_memory / 1024**3)}GB, "
1515
+ f"CC {device_info.major}.{device_info.minor}, {device_info.multi_processor_count} SM(s)"
1616
)
1717

src/animatediff/utils/pipeline.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def send_to_device(
1919
force_half: bool = False,
2020
compile: bool = False,
2121
) -> AnimationPipeline:
22-
logger.info(f"Sending pipeline to device \"{device.type}{device.index if device.index else ''}\"")
22+
logger.info(f'Sending pipeline to device "{device.type}{device.index if device.index else ""}"')
2323

2424
# Freeze model weights and force-disable training
2525
if freeze or compile:

0 commit comments

Comments
 (0)