File tree Expand file tree Collapse file tree 2 files changed +428
-3
lines changed
src/compressed_tensors/utils Expand file tree Collapse file tree 2 files changed +428
-3
lines changed Original file line number Diff line number Diff line change 14
14
15
15
import logging
16
16
import re
17
- from collections import OrderedDict
18
17
from collections .abc import Generator
19
18
from typing import Iterable , Tuple
20
19
@@ -153,7 +152,7 @@ def match_modules_set(
153
152
matches [target ] = module
154
153
155
154
# once we have a full set, yield and reset
156
- if all (matches [target ] is not None for target in targets ):
155
+ if targets and all (( matches [target ] is not None for target in targets ) ):
157
156
yield [matches [target ] for target in targets ] # ensure correct ordering
158
157
matches = dict .fromkeys (targets , None )
159
158
@@ -176,7 +175,7 @@ def match_name(name: str, target: str) -> bool:
176
175
regex matches or if target string exactly matches name
177
176
"""
178
177
if target .startswith ("re:" ):
179
- return re .match (target .removeprefix ("re:" ), name )
178
+ return re .match (target .removeprefix ("re:" ), name ) is not None
180
179
else :
181
180
return target == name
182
181
You can’t perform that action at this time.
0 commit comments