From 50780499edce9217c857ebcd6402371aa3fe3c44 Mon Sep 17 00:00:00 2001 From: Kingsley Date: Wed, 27 Aug 2025 11:45:24 +0800 Subject: [PATCH] [data] Fix glm4v mmplugin when not expand (#9029) --- src/llamafactory/data/mm_plugin.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/llamafactory/data/mm_plugin.py b/src/llamafactory/data/mm_plugin.py index be8cea9d..a3a6a4d9 100644 --- a/src/llamafactory/data/mm_plugin.py +++ b/src/llamafactory/data/mm_plugin.py @@ -1630,6 +1630,9 @@ class GLM4VPlugin(Qwen2VLPlugin): ) video_structure += frame_structure + if not self.expand_mm_tokens: + video_structure = self.video_token + content = content.replace(VIDEO_PLACEHOLDER, f"<|begin_of_video|>{video_structure}<|end_of_video|>", 1) num_video_tokens += 1