11from collections import defaultdict
2- from typing import Tuple
32
43import torch
54from 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
152151def _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
178177def _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