diff --git a/.github/workflows/causal_lm_cpp.yml b/.github/workflows/causal_lm_cpp.yml index fb0c9c4b0b..61a5c4a69a 100644 --- a/.github/workflows/causal_lm_cpp.yml +++ b/.github/workflows/causal_lm_cpp.yml @@ -274,6 +274,47 @@ jobs: && call .\ov\setupvars.bat && python samples\python\text_generation\lora.py .\TinyLlama\TinyLlama-1.1B-intermediate-step-1431k-3T\ adapter_model.safetensors "How to create a table with two columns, one of them has type float, another one has type int?" + cpp-greedy_causal_lm-Chatglm3-6b: + runs-on: ubuntu-20.04-4-cores + defaults: + run: + shell: bash + steps: + - uses: actions/checkout@v4 + with: + submodules: recursive + - uses: actions/setup-python@v4 + with: + python-version: 3.11 + - name: Install OpenVINO + run: | + mkdir ./ov/ + curl ${{ env.l_ov_link }} | tar --directory ./ov/ --strip-components 1 -xz + sudo ./ov/install_dependencies/install_openvino_dependencies.sh + - name: Build app + run: | + source ./ov/setupvars.sh + cmake -DCMAKE_BUILD_TYPE=Release -S ./ -B ./build/ + cmake --build ./build/ --config Release -j + - name: Download and convert and model + run: | + source ./ov/setupvars.sh + python -m pip install --upgrade-strategy eager -r ./samples/requirements.txt + python -m pip install ./thirdparty/openvino_tokenizers/[transformers] --pre --extra-index-url https://storage.openvinotoolkit.org/simple/wheels/nightly + optimum-cli export openvino --trust-remote-code --weight-format fp16 --model THUDM/chatglm3-6b chatglm3-6b --task text-generation-with-past + - name: Run C++ and Python Samples and Comparing generated output - Chatglm3-6b + run: | + . ./ov/setupvars.sh + echo "why sun is yellow?" > ./prompt.txt + echo '--------------------------------C++ Generated--------------------------------------------------' + ./build/samples/cpp/greedy_causal_lm/greedy_causal_lm ./chatglm3-6b/ "$( ./prompt.txt + + ./build/samples/cpp/prompt_lookup_decoding_lm/prompt_lookup_decoding_lm ./Qwen-7B-Chat/ "$( predictions_prompt_lookup.txt + ./build/samples/cpp/text_generation/greedy_causal_lm ./Qwen-7B-Chat/ "$( predictions_greedy.txt + python -c " + with open('predictions_greedy.txt', 'r') as f: + predicted_greedy = f.readline() + with open('predictions_prompt_lookup.txt', 'r') as f: + predicted_prompt_lookup = f.readline() + assert predicted_greedy == predicted_prompt_lookup + " + echo "Prompt lookup" passed + - name: run and compare + run: | + source ./ov/setupvars.sh + + echo 'Code:```python + def add(a, b): + return a + b + ``` + Question: Can you please add 2 and 3 + A:' > ./prompt.txt + + echo '-------------------------------Prompt lookup Generated-----------------------------------------' + ./build/samples/cpp/prompt_lookup_decoding_lm/prompt_lookup_decoding_lm ./chatglm3-6b/ "$( [!NOTE] -> Models should belong to the same family and have the same tokenizers. +>* Models should belong to the same family and have the same tokenizers. +>* `optimum-cli` requires the `--task text-generation-with-past` argument for the `THUDM/chatglm3-6b` model +>* The **beam search** is not supported for `THUDM/chatglm3-6b` model. ## Image generation models diff --git a/tests/python_tests/ov_genai_test_utils.py b/tests/python_tests/ov_genai_test_utils.py index 00c74f6628..08be419ef0 100644 --- a/tests/python_tests/ov_genai_test_utils.py +++ b/tests/python_tests/ov_genai_test_utils.py @@ -27,6 +27,7 @@ def get_models_list(): "microsoft/phi-1_5", "microsoft/phi-2", "THUDM/chatglm2-6b", + "THUDM/chatglm3-6b", # no beam_search "Qwen/Qwen2-0.5B-Instruct", "Qwen/Qwen-7B-Chat", "Qwen/Qwen1.5-7B-Chat",