From 08b821e792be6ee0816235e838a66d3ff8f2506d Mon Sep 17 00:00:00 2001 From: Kota Tsuyuzaki Date: Thu, 2 May 2024 14:34:15 +0900 Subject: [PATCH] Define hf_config explisitly for convert_hf_mpt_legacy Otherwise, the convert_hf_mpt_legacy call may fail when the function is called in other than global scope because the function refers hf_config in the global scope right now. --- examples/mpt/convert_checkpoint.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/examples/mpt/convert_checkpoint.py b/examples/mpt/convert_checkpoint.py index 6151572714c..8900325214a 100644 --- a/examples/mpt/convert_checkpoint.py +++ b/examples/mpt/convert_checkpoint.py @@ -640,6 +640,7 @@ def get_tllm_param( def convert_hf_mpt_legacy(hf_model, + hf_config, mapping, rank=0, dtype='float32', @@ -1059,6 +1060,7 @@ def covert_and_save(rank): if args.smoothquant is not None or args.calibrate_kv_cache: weights = convert_hf_mpt_legacy( hf_model, + hf_config, mapping, rank, dtype=args.dtype,