Skip to content

Commit b5b9b2b

Browse files
committed
Fix misc flake8 errors
Signed-off-by: Fynn Schmitt-Ulms <[email protected]>
1 parent 03560cf commit b5b9b2b

File tree

4 files changed

+6
-7
lines changed

4 files changed

+6
-7
lines changed

src/compressed_tensors/utils/offload.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,6 @@ def disable_hf_hook(module: torch.nn.Module):
282282
hooks = {}
283283

284284
def collect_hooks(module):
285-
nonlocal hooks
286285
if hasattr(module, "_hf_hook"):
287286
hooks[module] = module._hf_hook
288287
remove_hook_from_module(module)

tests/test_examples/test_bitmask_compression_ipynb.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717

1818
nbformat = pytest.importorskip("nbformat")
19-
from nbconvert.preprocessors import ExecutePreprocessor
19+
from nbconvert.preprocessors import ExecutePreprocessor # noqa: E402
2020

2121

2222
@pytest.mark.skip(

tests/test_transform/test_transform_config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,6 @@ def test_multiple_groups():
6666
type="hadamard",
6767
apply=[linear_args_2],
6868
)
69-
config = TransformConfig(
69+
_ = TransformConfig(
7070
config_groups={"transform_0": scheme_1, "transform_1": scheme_2}
7171
)

tests/test_utils/test_offload.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -441,8 +441,8 @@ def test_delete_offload_module(exec_device):
441441
register_offload_module(model.linear, "child", child)
442442
delete_offload_module(model, "child")
443443
delete_offload_module(model.linear, "child")
444-
assert not child in model.children()
445-
assert not child in model.linear.children()
444+
assert child not in model.children()
445+
assert child not in model.linear.children()
446446

447447
# with offloading
448448
model = ExampleModel()
@@ -452,8 +452,8 @@ def test_delete_offload_module(exec_device):
452452
register_offload_module(model.linear, "child", child)
453453
delete_offload_module(model, "child")
454454
delete_offload_module(model.linear, "child")
455-
assert not child in model.children()
456-
assert not child in model.linear.children()
455+
assert child not in model.children()
456+
assert child not in model.linear.children()
457457

458458

459459
@requires_gpu

0 commit comments

Comments
 (0)