Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions python/sglang/srt/layers/quantization/base_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ class QuantizationConfig(ABC):
def __init__(self):
super().__init__()
# mapping is updated by models as they initialize
self.packed_modules_mapping: Dict[str, List[str]] = dict()
self.packed_modules_mapping: Dict[str, List[str]] = {}

@abstractmethod
def get_name(self) -> str:
Expand Down Expand Up @@ -175,10 +175,10 @@ def get_from_keys(config: Dict[str, Any], keys: List[str]) -> Any:
@staticmethod
def get_from_keys_or(config: Dict[str, Any], keys: List[str], default: Any) -> Any:
"""Get a optional value from the model's quantization config."""
try:
return QuantizationConfig.get_from_keys(config, keys)
except ValueError:
return default
for key in keys:
if key in config:
return config[key]
return default

@abstractmethod
def get_quant_method(
Expand Down
5 changes: 1 addition & 4 deletions python/sglang/srt/layers/quantization/moe_wna16.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,7 @@ def __init__(
else:
raise ValueError("moe_wna16 only support gptq and awq.")

if modules_to_not_convert is None:
self.modules_to_not_convert = []
else:
self.modules_to_not_convert = modules_to_not_convert
self.modules_to_not_convert = modules_to_not_convert or []

@classmethod
def get_name(cls) -> str:
Expand Down