Skip to content

Commit fdb64b5

Browse files
committed
add rotation validation
Signed-off-by: Kyle Sayers <[email protected]>
1 parent f77226d commit fdb64b5

File tree

1 file changed

+6
-0
lines changed
  • src/llmcompressor/modifiers/transform/spinquant

1 file changed

+6
-0
lines changed

src/llmcompressor/modifiers/transform/spinquant/base.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,12 @@ class SpinQuantModifier(Modifier):
8787

8888
transform_config: Optional[TransformConfig] = None # optional override for more fine-grained control
8989

90+
@field_validator("rotations", mode="before")
91+
def validate_rotations(cls, value):
92+
if isinstance(value, Iterable):
93+
return tuple(v.upper() for v in value)
94+
return value
95+
9096
def on_initialize(self, state: State, **kwargs) -> bool:
9197
# HARDCODE
9298
self.mappings = llama_spinquant

0 commit comments

Comments
 (0)