Skip to content

Commit

Permalink
if conversion is needed, we need to use the converted model state_dic…
Browse files Browse the repository at this point in the history
…t(). (ModelCloud#54)

Co-authored-by: LRL-ModelCloud <[email protected]>
  • Loading branch information
LRL-ModelCloud and LRL-ModelCloud authored Jun 25, 2024
1 parent a976dd4 commit b783bcd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gptqmodel/models/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -500,8 +500,6 @@ def save_quantized(
f"gptq_model-{self.quantize_config.bits}bit-{self.quantize_config.group_size}g"
)

state_dict = self.model.state_dict()

if format == FORMAT.GPTQ_V2 or (format is None and quantize_config.format == FORMAT.GPTQ_V2):
logger.warning(
f"Using 'format = {FORMAT.GPTQ_V2}': the serialized model is only supported by GPTQModel version >= {MIN_VERSION_WITH_V2}."
Expand Down Expand Up @@ -566,6 +564,8 @@ def save_quantized(

model.to(CPU)

state_dict = model.state_dict()

if quantize_config.model_file_base_name is None:
if use_safetensors:
model_base_name = "model"
Expand Down

0 comments on commit b783bcd

Please sign in to comment.