From 539d01adec8e7b51c072f6128f8e5937a0d8b56e Mon Sep 17 00:00:00 2001 From: yuwenzho Date: Fri, 26 Jul 2024 08:54:40 +0800 Subject: [PATCH] fix bug Signed-off-by: yuwenzho --- .../quantization/weight_only/run_benchmark.sh | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/examples/nlp/huggingface_model/text_generation/quantization/weight_only/run_benchmark.sh b/examples/nlp/huggingface_model/text_generation/quantization/weight_only/run_benchmark.sh index 1f728c0f1..72348427c 100644 --- a/examples/nlp/huggingface_model/text_generation/quantization/weight_only/run_benchmark.sh +++ b/examples/nlp/huggingface_model/text_generation/quantization/weight_only/run_benchmark.sh @@ -35,23 +35,27 @@ function init_params { # run_benchmark function run_benchmark { - + # Check if the input_model ends with the filename extension ".onnx" if [[ $input_model =~ \.onnx$ ]]; then # If the string ends with the filename extension, get the path of the file input_model=$(dirname "$input_model") fi - python main.py \ + if [[ "${tokenizer}" =~ "Phi-3-mini" ]]; then + extra_cmd="--trust_remote_code True" + fi + + eval "python main.py \ --model_path ${input_model} \ --batch_size=${batch_size-1} \ --tokenizer=${tokenizer-meta-llama/Llama-2-7b-hf} \ --tasks=${tasks-lambada_openai} \ --mode=${mode} \ --intra_op_num_threads=${intra_op_num_threads-24} \ - --benchmark - + --benchmark \ + ${extra_cmd}" + } main "$@" -