From 53a12282bcb0ba394c4ebee8022bf9d7e2eb905e Mon Sep 17 00:00:00 2001 From: NanoCode012 Date: Sat, 14 Feb 2026 00:45:01 +0700 Subject: [PATCH] fix: log merge command once done --- src/axolotl/integrations/gemma3/plugin.py | 28 +++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/src/axolotl/integrations/gemma3/plugin.py b/src/axolotl/integrations/gemma3/plugin.py index ce29bd2fb..fc0d8361d 100644 --- a/src/axolotl/integrations/gemma3/plugin.py +++ b/src/axolotl/integrations/gemma3/plugin.py @@ -77,3 +77,31 @@ class Gemma3TextFromMultimodalPlugin(BasePlugin): "Gemma3TextFromMultimodalPlugin enabled. " "Please disable one of the two." ) + + def post_train(self, cfg, model): + """Log merge command after training completes.""" + if cfg.adapter: + LOG.info( + "Adapter training detected. To reconstruct the multimodal checkpoint:\n" + " 1. Merge adapter weights into the text-only base model:\n" + " axolotl merge_lora \n" + " 2. Then merge the resulting full model back into the multimodal checkpoint:\n" + " python scripts/merge_gemma3_multimodal_weights.py \\\n" + " --original-model %s \\\n" + " --trained-model %s/merged \\\n" + " --output-dir %s/multi-modal/merged", + cfg.base_model, + cfg.output_dir, + cfg.output_dir, + ) + else: + LOG.info( + "To merge trained weights back into the multimodal checkpoint, run:\n" + " python scripts/merge_gemma3_multimodal_weights.py \\\n" + " --original-model %s \\\n" + " --trained-model %s \\\n" + " --output-dir %s/multi-modal/merged", + cfg.base_model, + cfg.output_dir, + cfg.output_dir, + )