Skip to content
This repository was archived by the owner on Oct 25, 2024. It is now read-only.
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -840,6 +840,12 @@ def forward(self, input: torch.Tensor) -> tuple[torch.Tensor, None]:
or device_map == torch.device("cpu")
) and model.config.model_type == "chatglm":
model = model.float()
if (
not torch.cuda.is_available()
or device_map == "cpu"
or device_map == torch.device("cpu")
) and model.config.model_type == "mpt":
model.config.architectures = ["MptForCausalLM"]
model.eval()
model_type = model.config.model_type.replace("_", "-")

Expand Down Expand Up @@ -1077,6 +1083,7 @@ def calib_func(model):
recipes=quantization_config.recipes,
example_inputs=example_inputs,
)

model = quantization.fit(
model,
conf,
Expand Down