fix typos
This commit is contained in:
committed by
Sung Ching Liu
parent
feaef03cb9
commit
987c5217a0
@@ -11,7 +11,7 @@ from pydantic import BaseModel, Field, model_validator
|
|||||||
class HQQConfig(BaseModel):
|
class HQQConfig(BaseModel):
|
||||||
"""HQQ configuration subset"""
|
"""HQQ configuration subset"""
|
||||||
|
|
||||||
n_bits: int | None = Field(default=None)
|
nbits: int | None = Field(default=None)
|
||||||
group_size: int | None = Field(default=None)
|
group_size: int | None = Field(default=None)
|
||||||
target_modules: list[str] | str | None = Field(
|
target_modules: list[str] | str | None = Field(
|
||||||
default=None,
|
default=None,
|
||||||
@@ -51,7 +51,7 @@ def get_hqq_quant_config_kwargs(cfg):
|
|||||||
# If no target module is specified, then target the whole model
|
# If no target module is specified, then target the whole model
|
||||||
if len(cfg.hqq_config) == 1 and cfg.hqq_config[0].target_modules is None:
|
if len(cfg.hqq_config) == 1 and cfg.hqq_config[0].target_modules is None:
|
||||||
return {
|
return {
|
||||||
"nbits": cfg.hqq_config[0].n_bits,
|
"nbits": cfg.hqq_config[0].nbits,
|
||||||
"group_size": cfg.hqq_config[0].group_size,
|
"group_size": cfg.hqq_config[0].group_size,
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -63,8 +63,8 @@ def get_hqq_quant_config_kwargs(cfg):
|
|||||||
|
|
||||||
for module in target_modules:
|
for module in target_modules:
|
||||||
hqq_quant_config_kwargs["dynamic_config"][module] = {
|
hqq_quant_config_kwargs["dynamic_config"][module] = {
|
||||||
"nbits": hqq_config.hqq_nbits,
|
"nbits": hqq_config.nbits,
|
||||||
"group_size": hqq_config.hqq_group_size,
|
"group_size": hqq_config.group_size,
|
||||||
}
|
}
|
||||||
|
|
||||||
return hqq_quant_config_kwargs
|
return hqq_quant_config_kwargs
|
||||||
|
|||||||
@@ -36,11 +36,11 @@ class TestHQQ(unittest.TestCase):
|
|||||||
"use_hqq": True,
|
"use_hqq": True,
|
||||||
"hqq_config": [
|
"hqq_config": [
|
||||||
{
|
{
|
||||||
"nbits": 4,
|
"nbits": 8,
|
||||||
"group_size": 32,
|
"group_size": 32,
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"lora_adapter": "qlora",
|
"adapter": "lora",
|
||||||
"lora_r": 16,
|
"lora_r": 16,
|
||||||
"lora_alpha": 32,
|
"lora_alpha": 32,
|
||||||
"lora_dropout": 0.05,
|
"lora_dropout": 0.05,
|
||||||
|
|||||||
Reference in New Issue
Block a user