From 4a1b201370e4b462e180950e926f7b092335e29c Mon Sep 17 00:00:00 2001 From: whcao <41630003+HIT-cwh@users.noreply.github.com> Date: Sun, 29 Sep 2024 10:45:26 +0800 Subject: [PATCH] [Bugs] fix qlora convert bugs (#930) fix qlora convert bugs --- xtuner/tools/model_converters/pth_to_hf.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/xtuner/tools/model_converters/pth_to_hf.py b/xtuner/tools/model_converters/pth_to_hf.py index 33a18e0df..2a4b28883 100644 --- a/xtuner/tools/model_converters/pth_to_hf.py +++ b/xtuner/tools/model_converters/pth_to_hf.py @@ -83,6 +83,9 @@ def main(): if 'Reward' in model_name: use_meta_init = False cfg.model.llm.pop('quantization_config', None) + if hasattr(cfg.model.llm, 'quantization_config'): + # Can not build a qlora model on meta device + use_meta_init = False if use_meta_init: try: