From 39e004525437982f0a158e276673da6b1428ac2c Mon Sep 17 00:00:00 2001 From: intellinjun Date: Wed, 29 May 2024 17:04:44 +0800 Subject: [PATCH] update ci Signed-off-by: intellinjun --- neural_speed/convert/convert_baichuan.py | 10 ++++++++-- tests/model-test/cpp_graph_inference.sh | 3 ++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/neural_speed/convert/convert_baichuan.py b/neural_speed/convert/convert_baichuan.py index fea0641a9..62595d996 100644 --- a/neural_speed/convert/convert_baichuan.py +++ b/neural_speed/convert/convert_baichuan.py @@ -144,7 +144,10 @@ def baichuan13B_convert(model, tokenizer, dir_model, fname_out, ftype, hparams): fout.write(struct.pack("i", hparams["num_hidden_layers"])) fout.write(struct.pack("i", 0)) fout.write(struct.pack("i", ftype)) - fout.write(struct.pack("i", hparams["model_max_length"])) + if "max_position_embeddings" in hparams: + fout.write(struct.pack("i", hparams["max_position_embeddings"])) + else: + fout.write(struct.pack("i", hparams["model_max_length"])) fout.write(struct.pack("f", 0)) fout.write(struct.pack("f", 0)) fout.write(struct.pack("i", 0)) @@ -248,7 +251,10 @@ def baichuan7B_convert(model, tokenizer, dir_model, fname_out, ftype, hparams): fout.write(struct.pack("i", hparams["num_hidden_layers"])) fout.write(struct.pack("i", 128)) fout.write(struct.pack("i", ftype)) - fout.write(struct.pack("i", hparams["model_max_length"])) + if "max_position_embeddings" in hparams: + fout.write(struct.pack("i", hparams["max_position_embeddings"])) + else: + fout.write(struct.pack("i", hparams["model_max_length"])) fout.write(struct.pack("f", 0)) fout.write(struct.pack("f", 0)) fout.write(struct.pack("i", 0)) diff --git a/tests/model-test/cpp_graph_inference.sh b/tests/model-test/cpp_graph_inference.sh index 63b7e3a8b..b8886fa39 100644 --- a/tests/model-test/cpp_graph_inference.sh +++ b/tests/model-test/cpp_graph_inference.sh @@ -146,7 +146,7 @@ model_name_map["starcoder-3b"]="bigcode/starcoder" model_name_map["bloom-7b"]="bigscience/bloom-7b1" model_name_map["opt-1.3b"]="facebook/opt-1.3b" model_name_map["dolly-v2-3b"]="databricks/dolly-v2-3b" -model_name_map["chatglm3"]="THUDM/chatglm3-6b" +model_name_map["chatglm3-6b"]="THUDM/chatglm3-6b" model_name_map["chatglm2"]="THUDM/chatglm2-6b" model_name_map["chatglm-6b"]="THUDM/chatglm-6b" model_name_map["baichuan2-13b"]="baichuan-inc/Baichuan2-13B-Chat" @@ -363,6 +363,7 @@ function main() { ninja cd .. pip install -r $working_dir/requirements.txt + pip install lm_eval python $working_dir/setup.py install ## prepare example requirement if [[ -f $requirements_file ]]; then