From 445163ab5efe7edefc50b9db94709aaca691a4f6 Mon Sep 17 00:00:00 2001 From: Karunanidhi Mishra Date: Tue, 7 Jul 2026 04:30:34 -0500 Subject: [PATCH] [misc] fix typos in comments and help text (#10633) Co-authored-by: Karunanidhi Mishra <11963379+kmishra1204@users.noreply.github.com> --- src/llamafactory/data/mm_plugin.py | 4 ++-- src/llamafactory/data/template.py | 4 ++-- src/llamafactory/hparams/evaluation_args.py | 2 +- src/llamafactory/hparams/finetuning_args.py | 4 ++-- src/llamafactory/webui/control.py | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/llamafactory/data/mm_plugin.py b/src/llamafactory/data/mm_plugin.py index 0dc04a3c5..8c2d66c2f 100644 --- a/src/llamafactory/data/mm_plugin.py +++ b/src/llamafactory/data/mm_plugin.py @@ -929,7 +929,7 @@ class InternVLPlugin(BasePlugin): messages = deepcopy(messages) mm_inputs = self._get_mm_inputs(images, videos, audios, processor) - image_pixel_patch_list = mm_inputs.get("image_num_patches") # pathes of images + image_pixel_patch_list = mm_inputs.get("image_num_patches") # patches of images video_num_patches = mm_inputs.get("video_num_patches") # all patches for frames of videos video_patch_indices = mm_inputs.get("video_patch_indices") # num frames of per video @@ -2667,7 +2667,7 @@ class Qwen2OmniPlugin(Qwen2VLPlugin): if ( use_audio_in_video and len(audios) and len(videos) - ): # if use the audio of video # deal video token and audio token togather + ): # if use the audio of video # deal video token and audio token together if len(videos) != len(audios): raise ValueError( f"Number of videos ({len(videos)}) must match number of audios ({len(audios)}) when using audio in video." diff --git a/src/llamafactory/data/template.py b/src/llamafactory/data/template.py index b867edb60..492909eea 100644 --- a/src/llamafactory/data/template.py +++ b/src/llamafactory/data/template.py @@ -1035,7 +1035,7 @@ register_template( format_assistant=StringFormatter(slots=["{{content}}\n"]), format_system=StringFormatter( slots=["<|turn>system\n<|think|>{{content}}\n"] - ), # default thought singal contained + ), # default thought signal contained format_observation=StringFormatter( slots=["<|turn>tool\n{{content}}\n<|turn>model\n"] ), # seem not consistent with the chattemplate @@ -1061,7 +1061,7 @@ register_template( format_assistant=StringFormatter(slots=["{{content}}\n"]), format_system=StringFormatter( slots=["<|turn>system\n<|think|>{{content}}\n"] - ), # default thought singal contained + ), # default thought signal contained format_observation=StringFormatter(slots=["<|turn>tool\n{{content}}\n<|turn>model\n"]), format_tools=ToolFormatter(tool_format="gemma4"), format_function=FunctionFormatter(slots=["<|tool>{{content}}"], tool_format="gemma4"), diff --git a/src/llamafactory/hparams/evaluation_args.py b/src/llamafactory/hparams/evaluation_args.py index eddc618ba..4826ec5d6 100644 --- a/src/llamafactory/hparams/evaluation_args.py +++ b/src/llamafactory/hparams/evaluation_args.py @@ -44,7 +44,7 @@ class EvaluationArguments: ) n_shot: int = field( default=5, - metadata={"help": "Number of examplars for few-shot learning."}, + metadata={"help": "Number of exemplars for few-shot learning."}, ) save_dir: str | None = field( default=None, diff --git a/src/llamafactory/hparams/finetuning_args.py b/src/llamafactory/hparams/finetuning_args.py index 2fa199695..70a8e6e20 100644 --- a/src/llamafactory/hparams/finetuning_args.py +++ b/src/llamafactory/hparams/finetuning_args.py @@ -385,7 +385,7 @@ class BAdamArgument: "help": ( "The mode of the mask for BAdam optimizer. " "`adjacent` means that the trainable parameters are adjacent to each other, " - "`scatter` means that trainable parameters are randomly choosed from the weight." + "`scatter` means that trainable parameters are randomly chosen from the weight." ) }, ) @@ -530,7 +530,7 @@ class FinetuningArguments( ) freeze_vision_tower: bool = field( default=True, - metadata={"help": "Whether ot not to freeze the vision tower in MLLM training."}, + metadata={"help": "Whether or not to freeze the vision tower in MLLM training."}, ) freeze_multi_modal_projector: bool = field( default=True, diff --git a/src/llamafactory/webui/control.py b/src/llamafactory/webui/control.py index ec99f4079..2dbbdbd83 100644 --- a/src/llamafactory/webui/control.py +++ b/src/llamafactory/webui/control.py @@ -105,7 +105,7 @@ def check_template(lang: str, template: str) -> None: def get_trainer_info(lang: str, output_path: os.PathLike, do_train: bool) -> tuple[str, "gr.Slider", dict[str, Any]]: - r"""Get training infomation for monitor. + r"""Get training information for monitor. If do_train is True: Inputs: top.lang, train.output_path