forked from intel/intel-extension-for-transformers
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpylint.sh
55 lines (47 loc) · 2.26 KB
/
pylint.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/bin/bash
source /intel-extension-for-transformers/.github/workflows/script/change_color.sh
cd /intel-extension-for-transformers
$BOLD_YELLOW && echo "---------------- git submodule update --init --recursive -------------" && $RESET
git config --global --add safe.directory "*"
git submodule update --init --recursive
$BOLD_YELLOW && echo "---------------- install ITREX -------------" && $RESET
export PYTHONPATH=`pwd`
pip list
cd /intel-extension-for-transformers/intel_extension_for_transformers/neural_chat/
if [ -f "requirements.txt" ]; then
python -m pip install --default-timeout=100 -r requirements.txt
pip list
else
echo "Not found requirements.txt file."
fi
cd /intel-extension-for-transformers
log_dir=/intel-extension-for-transformers/.github/workflows/script/formatScan
if [ -f "requirements.txt" ]; then
python -m pip install --default-timeout=100 -r requirements.txt
pip list
else
echo "Not found requirements.txt file."
fi
# install packages
pip install accelerate nlpaug nltk schema optimum-intel
pip install git+https://github.com/EleutherAI/lm-evaluation-harness.git@83dbfbf6070324f3e5872f63e49d49ff7ef4c9b3
echo "[DEBUG] list pipdeptree..."
pip install pipdeptree
pipdeptree
python -m pylint -f json --disable=R,C,W,E1129 \
--enable=line-too-long \
--max-line-length=120 \
--extension-pkg-whitelist=numpy,nltk \
--ignored-classes=TensorProto,NodeProto \
--ignored-modules=tensorflow,torch,torch.quantization,torch.tensor,torchvision,mxnet,onnx,onnxruntime,neural_compressor,neural_compressor.benchmark,intel_extension_for_transformers.neural_engine_py \
/intel-extension-for-transformers/intel_extension_for_transformers >${log_dir}/pylint.json
exit_code=$?
$BOLD_YELLOW && echo " ----------------- Current log file output start --------------------------" && $RESET
cat ${log_dir}/pylint.json
$BOLD_YELLOW && echo " ----------------- Current log file output end --------------------------" && $RESET
if [ ${exit_code} -ne 0 ]; then
$BOLD_RED && echo "Error!! Please Click on the artifact button to download and view Pylint error details." && $RESET
exit 1
fi
$BOLD_PURPLE && echo "Congratulations, Pylint check passed!" && $LIGHT_PURPLE && echo " You can click on the artifact button to see the log details." && $RESET
exit 0