Skip to content

Commit 1a8222a

Browse files
committed
Update tuple typehint
1 parent 19715e0 commit 1a8222a

File tree

1 file changed

+3
-4
lines changed
  • src/llmcompressor/transformers/compression

1 file changed

+3
-4
lines changed

src/llmcompressor/transformers/compression/helpers.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
from collections import defaultdict
2-
from typing import Tuple
32

43
import torch
54
from accelerate.accelerator import get_state_dict_offloaded_model
@@ -104,7 +103,7 @@ def infer_sparse_targets_and_ignores(
104103
model: torch.nn.Module,
105104
sparsity_structure: str,
106105
sparsity_threshold: float,
107-
) -> Tuple[list[str], list[str]]:
106+
) -> tuple[list[str], list[str]]:
108107
"""
109108
Infers the target and ignore layers in the given model
110109
to be used for sparsity compression
@@ -151,7 +150,7 @@ def is_sparse_compression_target(
151150

152151
def _get_sparse_targets_ignore_dicts(
153152
module: torch.nn.Module, sparsity_structure: str, sparsity_threshold: float
154-
) -> Tuple[dict[str, list[str]], dict[str, list[str]]]:
153+
) -> tuple[dict[str, list[str]], dict[str, list[str]]]:
155154
"""
156155
Get sparse targets and ignore dictionaries
157156
@@ -177,7 +176,7 @@ def _get_sparse_targets_ignore_dicts(
177176

178177
def _reduce_targets_and_ignores_into_lists(
179178
exhaustive_targets: dict[str, list[str]], exhaustive_ignore: dict[str, list[str]]
180-
) -> Tuple[list[str], list[str]]:
179+
) -> tuple[list[str], list[str]]:
181180
"""
182181
Reduces the targets and ignores dictionaries into lists
183182

0 commit comments

Comments
 (0)