Skip to content
This repository was archived by the owner on Oct 25, 2024. It is now read-only.

Commit b1b407f

Browse files
authored
[LLM Runtime] Circumvent dependabot check for chatglm/baichuan/baichuan2 (#1078)
1 parent ec3d38a commit b1b407f

File tree

5 files changed

+49
-10
lines changed

5 files changed

+49
-10
lines changed

intel_extension_for_transformers/llm/runtime/graph/scripts/ci/cpp_graph_inference.sh

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -210,17 +210,17 @@ function main() {
210210
quant_script="./build/bin/quant_chatglm"
211211
infer_cmd="python ./scripts/inference.py"
212212
extension=" --model_name chatglm --tokenizer $model_path"
213-
requirements_file="scripts/requirements/chatglm-6b.txt"
213+
requirements_file="scripts/requirements/chatglm-6b.sh"
214214
elif [[ "${model}" == "baichuan2-13b" ]]; then
215215
quant_script="./build/bin/quant_baichuan"
216216
infer_cmd="python ./scripts/inference.py"
217-
requirements_file="scripts/requirements/baichuan.txt"
217+
requirements_file="scripts/requirements/baichuan.sh"
218218
extension=" --model_name baichuan --tokenizer $model_path"
219219
elif [[ "${model}" == "baichuan-13b" ]]; then
220220
quant_script="./build/bin/quant_baichuan"
221221
infer_cmd="python ./scripts/inference.py"
222222
extension=" --model_name baichuan --tokenizer $model_path"
223-
requirements_file="scripts/requirements/baichuan.txt"
223+
requirements_file="scripts/requirements/baichuan.sh"
224224
elif [[ "${model}" == "mistral-7b" ]]; then
225225
quant_script="./build/bin/quant_mistral"
226226
infer_cmd="./build/bin/run_mistral"
@@ -277,7 +277,14 @@ function main() {
277277
cd ..
278278

279279
## prepare example requiement
280-
pip install -r "$requirements_file"
280+
if [[ $requirements_file == *'.txt' ]]; then
281+
pip install -r "$requirements_file"
282+
elif [[ $requirements_file == *'.sh' ]]; then
283+
source "$requirements_file"
284+
else
285+
echo "Error: Unexpedted requirements_file: $requirements_file" 1>&2
286+
exit 1
287+
fi
281288

282289
echo "======= Convert Start ======="
283290
## prepare fp32 bin
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/bash
2+
#===============================================================================
3+
# Copyright (c) 2023 Intel Corporation
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
#===============================================================================
17+
18+
# To avoid the error: 'ChatGLMTokenizer' object has no attribute 'sp_tokenizer'
19+
pip install -r "$(dirname "${BASH_SOURCE[0]}")/common.txt" transformers==4.33.1

intel_extension_for_transformers/llm/runtime/graph/scripts/requirements/baichuan.txt

Lines changed: 0 additions & 3 deletions
This file was deleted.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/bash
2+
#===============================================================================
3+
# Copyright (c) 2023 Intel Corporation
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
#===============================================================================
17+
18+
# To avoid the error: 'ChatGLMTokenizer' object has no attribute 'sp_tokenizer'
19+
pip install -r "$(dirname "${BASH_SOURCE[0]}")/common.txt" transformers==4.33.1

intel_extension_for_transformers/llm/runtime/graph/scripts/requirements/chatglm-6b.txt

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)