[LLM] Fix example test (#9118)
* Update llm example test link due to example layout change * Add better change detect
This commit is contained in:
parent
ad7d9231f5
commit
0e09dd926b
2 changed files with 9 additions and 7 deletions
2
.github/workflows/llm_example_tests.yml
vendored
2
.github/workflows/llm_example_tests.yml
vendored
|
|
@ -18,6 +18,8 @@ on:
|
||||||
- '.github/actions/llm/setup-llm-env/action.yml'
|
- '.github/actions/llm/setup-llm-env/action.yml'
|
||||||
- '.github/actions/llm/remove-llm-env/action.yml'
|
- '.github/actions/llm/remove-llm-env/action.yml'
|
||||||
- '.github/actions/llm/download-llm-binary/action.yml'
|
- '.github/actions/llm/download-llm-binary/action.yml'
|
||||||
|
- 'python/llm/dev/test/run-example-tests.sh'
|
||||||
|
- 'python/llm/example/**'
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
workflow_call:
|
workflow_call:
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ if [ ! -d $ORIGINAL_LLAMA2_PATH ]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo ">>> Testing LLAMA2 transformers API"
|
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 "the output of the example is: "
|
||||||
echo $std
|
echo $std
|
||||||
if [[ ! $std == *"AI is a term"* ]]; then
|
if [[ ! $std == *"AI is a term"* ]]; then
|
||||||
|
|
@ -21,7 +21,7 @@ if [[ ! $std == *"AI is a term"* ]]; then
|
||||||
fi
|
fi
|
||||||
# transformers low-bit
|
# transformers low-bit
|
||||||
echo ">>> Testing LLAMA2 transformers API sym_int4"
|
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 "the output of the example is: "
|
||||||
echo $std
|
echo $std
|
||||||
if [[ ! $std == *"But her parents were always telling her to stay close to home"* ]]; then
|
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
|
fi
|
||||||
|
|
||||||
echo ">>> Testing LLAMA2 transformers API sym_int5"
|
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 "the output of the example is: "
|
||||||
echo $std
|
echo $std
|
||||||
if [[ ! $std == *"She wanted to go to places and meet new people"* ]]; then
|
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
|
return 1
|
||||||
fi
|
fi
|
||||||
echo ">>> Testing LLAMA2 transformers API sym_int8"
|
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 "the output of the example is: "
|
||||||
echo $std
|
echo $std
|
||||||
if [[ ! $std == *"She wanted to go to places and meet new people"* ]]; then
|
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
|
return 1
|
||||||
fi
|
fi
|
||||||
echo ">>> Testing LLAMA2 transformers API asym_int4"
|
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 "the output of the example is: "
|
||||||
echo $std
|
echo $std
|
||||||
if [[ ! $std == *"She wanted to go to places and meet new people"* ]]; then
|
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
|
fi
|
||||||
|
|
||||||
echo ">>> Testing LLAMA2 transformers API asym_int5"
|
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 "the output of the example is: "
|
||||||
echo $std
|
echo $std
|
||||||
if [[ ! $std == *"She wanted to go to places and meet new people"* ]]; then
|
if [[ ! $std == *"She wanted to go to places and meet new people"* ]]; then
|
||||||
|
|
@ -72,7 +72,7 @@ if [ ! -d $ORIGINAL_CHATGLM2_PATH ]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo ">>> Testing ChatGLM2 transformers API"
|
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 "the output of the example is: "
|
||||||
echo $std
|
echo $std
|
||||||
if [[ ! $std == *"AI指的是人工智能"* ]]; then
|
if [[ ! $std == *"AI指的是人工智能"* ]]; then
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue