From 0e09dd926b5abbd2be862c6d4e279c489e9ebcde Mon Sep 17 00:00:00 2001 From: Yuwen Hu <54161268+Oscilloscope98@users.noreply.github.com> Date: Tue, 10 Oct 2023 13:24:18 +0800 Subject: [PATCH] [LLM] Fix example test (#9118) * Update llm example test link due to example layout change * Add better change detect --- .github/workflows/llm_example_tests.yml | 2 ++ python/llm/dev/test/run-example-tests.sh | 14 +++++++------- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/.github/workflows/llm_example_tests.yml b/.github/workflows/llm_example_tests.yml index a2fee702..aa00771d 100644 --- a/.github/workflows/llm_example_tests.yml +++ b/.github/workflows/llm_example_tests.yml @@ -18,6 +18,8 @@ on: - '.github/actions/llm/setup-llm-env/action.yml' - '.github/actions/llm/remove-llm-env/action.yml' - '.github/actions/llm/download-llm-binary/action.yml' + - 'python/llm/dev/test/run-example-tests.sh' + - 'python/llm/example/**' workflow_dispatch: workflow_call: diff --git a/python/llm/dev/test/run-example-tests.sh b/python/llm/dev/test/run-example-tests.sh index 26dad2cc..edf767c8 100644 --- a/python/llm/dev/test/run-example-tests.sh +++ b/python/llm/dev/test/run-example-tests.sh @@ -12,7 +12,7 @@ if [ ! -d $ORIGINAL_LLAMA2_PATH ]; then fi echo ">>> Testing LLAMA2 transformers API" -std=$(taskset -c 0-$((THREAD_NUM - 1)) python python/llm/example/transformers/transformers_int4/llama2/generate.py --repo-id-or-model-path $ORIGINAL_LLAMA2_PATH) +std=$(taskset -c 0-$((THREAD_NUM - 1)) python python/llm/example/CPU/HF-Transformers-AutoModels/Model/llama2/generate.py --repo-id-or-model-path $ORIGINAL_LLAMA2_PATH) echo "the output of the example is: " echo $std if [[ ! $std == *"AI is a term"* ]]; then @@ -21,7 +21,7 @@ if [[ ! $std == *"AI is a term"* ]]; then fi # transformers low-bit echo ">>> Testing LLAMA2 transformers API sym_int4" -std=$(taskset -c 0-$((THREAD_NUM - 1)) python python/llm/example/transformers/transformers_low_bit/transformers_low_bit_pipeline.py --repo-id-or-model-path $ORIGINAL_LLAMA2_PATH) +std=$(taskset -c 0-$((THREAD_NUM - 1)) python python/llm/example/CPU/HF-Transformers-AutoModels/More-Data-Types/transformers_low_bit_pipeline.py --repo-id-or-model-path $ORIGINAL_LLAMA2_PATH) echo "the output of the example is: " echo $std if [[ ! $std == *"But her parents were always telling her to stay close to home"* ]]; then @@ -30,7 +30,7 @@ if [[ ! $std == *"But her parents were always telling her to stay close to home" fi echo ">>> Testing LLAMA2 transformers API sym_int5" -std=$(taskset -c 0-$((THREAD_NUM - 1)) python python/llm/example/transformers/transformers_low_bit/transformers_low_bit_pipeline.py --repo-id-or-model-path $ORIGINAL_LLAMA2_PATH --low-bit sym_int5) +std=$(taskset -c 0-$((THREAD_NUM - 1)) python python/llm/example/CPU/HF-Transformers-AutoModels/More-Data-Types/transformers_low_bit_pipeline.py --repo-id-or-model-path $ORIGINAL_LLAMA2_PATH --low-bit sym_int5) echo "the output of the example is: " echo $std if [[ ! $std == *"She wanted to go to places and meet new people"* ]]; then @@ -38,7 +38,7 @@ if [[ ! $std == *"She wanted to go to places and meet new people"* ]]; then return 1 fi echo ">>> Testing LLAMA2 transformers API sym_int8" -std=$(taskset -c 0-$((THREAD_NUM - 1)) python python/llm/example/transformers/transformers_low_bit/transformers_low_bit_pipeline.py --repo-id-or-model-path $ORIGINAL_LLAMA2_PATH --low-bit sym_int8) +std=$(taskset -c 0-$((THREAD_NUM - 1)) python python/llm/example/CPU/HF-Transformers-AutoModels/More-Data-Types/transformers_low_bit_pipeline.py --repo-id-or-model-path $ORIGINAL_LLAMA2_PATH --low-bit sym_int8) echo "the output of the example is: " echo $std if [[ ! $std == *"She wanted to go to places and meet new people"* ]]; then @@ -46,7 +46,7 @@ if [[ ! $std == *"She wanted to go to places and meet new people"* ]]; then return 1 fi echo ">>> Testing LLAMA2 transformers API asym_int4" -std=$(taskset -c 0-$((THREAD_NUM - 1)) python python/llm/example/transformers/transformers_low_bit/transformers_low_bit_pipeline.py --repo-id-or-model-path $ORIGINAL_LLAMA2_PATH --low-bit asym_int4) +std=$(taskset -c 0-$((THREAD_NUM - 1)) python python/llm/example/CPU/HF-Transformers-AutoModels/More-Data-Types/transformers_low_bit_pipeline.py --repo-id-or-model-path $ORIGINAL_LLAMA2_PATH --low-bit asym_int4) echo "the output of the example is: " echo $std if [[ ! $std == *"She wanted to go to places and meet new people"* ]]; then @@ -55,7 +55,7 @@ if [[ ! $std == *"She wanted to go to places and meet new people"* ]]; then fi echo ">>> Testing LLAMA2 transformers API asym_int5" -std=$(taskset -c 0-$((THREAD_NUM - 1)) python python/llm/example/transformers/transformers_low_bit/transformers_low_bit_pipeline.py --repo-id-or-model-path $ORIGINAL_LLAMA2_PATH --low-bit asym_int5) +std=$(taskset -c 0-$((THREAD_NUM - 1)) python python/llm/example/CPU/HF-Transformers-AutoModels/More-Data-Types/transformers_low_bit_pipeline.py --repo-id-or-model-path $ORIGINAL_LLAMA2_PATH --low-bit asym_int5) echo "the output of the example is: " echo $std if [[ ! $std == *"She wanted to go to places and meet new people"* ]]; then @@ -72,7 +72,7 @@ if [ ! -d $ORIGINAL_CHATGLM2_PATH ]; then fi echo ">>> Testing ChatGLM2 transformers API" -std=$(taskset -c 0-$((THREAD_NUM - 1)) python python/llm/example/transformers/transformers_int4/chatglm2/generate.py --repo-id-or-model-path $ORIGINAL_CHATGLM2_PATH) +std=$(taskset -c 0-$((THREAD_NUM - 1)) python python/llm/example/CPU/HF-Transformers-AutoModels/Model/chatglm2/generate.py --repo-id-or-model-path $ORIGINAL_CHATGLM2_PATH) echo "the output of the example is: " echo $std if [[ ! $std == *"AI指的是人工智能"* ]]; then