From ee8f5c30e78ce9f8fb88324a5eb8b5d86e1e8738 Mon Sep 17 00:00:00 2001 From: HIT-cwh <2892770585@qq.com> Date: Thu, 12 Sep 2024 09:16:09 +0000 Subject: [PATCH] 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: