mirror of
https://github.com/hiyouga/LLaMA-Factory.git
synced 2025-08-23 06:12:50 +08:00
add yivl and save processor to model_dir
Former-commit-id: afc6c7b9fd350f9f611a220363a3caa930ac56aa
This commit is contained in:
parent
9e247245a2
commit
92b184101f
@ -859,7 +859,7 @@ _register_template(
|
|||||||
_register_template(
|
_register_template(
|
||||||
name="yivl",
|
name="yivl",
|
||||||
format_user=StringFormatter(slots=["### Human: {{content}}\n### Assistant:"]),
|
format_user=StringFormatter(slots=["### Human: {{content}}\n### Assistant:"]),
|
||||||
format_assistant=StringFormatter(slots=[" {{content}}"]),
|
format_assistant=StringFormatter(slots=[" {{content}}\n"]),
|
||||||
stop_words=["###"],
|
stop_words=["###"],
|
||||||
default_system=(
|
default_system=(
|
||||||
"This is a chat between an inquisitive human and an AI assistant. "
|
"This is a chat between an inquisitive human and an AI assistant. "
|
||||||
|
@ -29,7 +29,8 @@ def autocast_projector_dtype(
|
|||||||
) -> "torch.Tensor":
|
) -> "torch.Tensor":
|
||||||
return output.to(model_args.compute_dtype)
|
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.config, "quantization_method", None)
|
||||||
|
or "Yi" in getattr(model.config.text_config, "_name_or_path", None)):
|
||||||
logger.info("Casting multimodal projector outputs in {}.".format(model_args.compute_dtype))
|
logger.info("Casting multimodal projector outputs in {}.".format(model_args.compute_dtype))
|
||||||
mm_projector: "torch.nn.Module" = getattr(model, mm_projector_name)
|
mm_projector: "torch.nn.Module" = getattr(model, mm_projector_name)
|
||||||
mm_projector.register_forward_hook(_mm_projector_forward_post_hook)
|
mm_projector.register_forward_hook(_mm_projector_forward_post_hook)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user