Former-commit-id: 08b695969049de8bf9bd3e90b9700736d90385ee
This commit is contained in:
hiyouga 2024-05-19 17:07:57 +08:00
parent a810d1b98e
commit 4f04e2ed93

View File

@ -69,7 +69,7 @@ def autocast_projector_dtype(
) -> "torch.Tensor":
return output.to(model_args.compute_dtype)
if hasattr(model, mm_projector_name) and getattr(model.config, "quantization_method", None):
if hasattr(model, mm_projector_name) and getattr(model, "quantization_method", None):
logger.info("Casting multimodal projector outputs in {}.".format(model_args.compute_dtype))
mm_projector: "torch.nn.Module" = getattr(model, mm_projector_name)
mm_projector.register_forward_hook(_mm_projector_forward_post_hook)