Upload ms-swift/.dev_scripts/ci_container_test.sh with huggingface_hub
Browse files
ms-swift/.dev_scripts/ci_container_test.sh
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
if [ "$MODELSCOPE_SDK_DEBUG" == "True" ]; then
|
| 2 |
+
# pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
|
| 3 |
+
pip install -r requirements/tests.txt -i https://mirrors.aliyun.com/pypi/simple/
|
| 4 |
+
git config --global --add safe.directory /ms-swift
|
| 5 |
+
git config --global user.email tmp
|
| 6 |
+
git config --global user.name tmp.com
|
| 7 |
+
|
| 8 |
+
# linter test
|
| 9 |
+
# use internal project for pre-commit due to the network problem
|
| 10 |
+
if [ `git remote -v | grep alibaba | wc -l` -gt 1 ]; then
|
| 11 |
+
pre-commit run -c .pre-commit-config_local.yaml --all-files
|
| 12 |
+
if [ $? -ne 0 ]; then
|
| 13 |
+
echo "linter test failed, please run 'pre-commit run --all-files' to check"
|
| 14 |
+
echo "From the repository folder"
|
| 15 |
+
echo "Run 'pip install -r requirements/tests.txt' install test dependencies."
|
| 16 |
+
echo "Run 'pre-commit install' install pre-commit hooks."
|
| 17 |
+
echo "Finally run linter with command: 'pre-commit run --all-files' to check."
|
| 18 |
+
echo "Ensure there is no failure!!!!!!!!"
|
| 19 |
+
exit -1
|
| 20 |
+
fi
|
| 21 |
+
fi
|
| 22 |
+
|
| 23 |
+
pip install -r requirements/framework.txt -U -i https://mirrors.aliyun.com/pypi/simple/
|
| 24 |
+
pip install diffusers decord einops -U -i https://mirrors.aliyun.com/pypi/simple/
|
| 25 |
+
pip install autoawq -U --no-deps
|
| 26 |
+
|
| 27 |
+
# test with install
|
| 28 |
+
pip install .
|
| 29 |
+
pip install auto_gptq bitsandbytes deepspeed -U -i https://mirrors.aliyun.com/pypi/simple/
|
| 30 |
+
else
|
| 31 |
+
echo "Running case in release image, run case directly!"
|
| 32 |
+
fi
|
| 33 |
+
# remove torch_extensions folder to avoid ci hang.
|
| 34 |
+
rm -rf ~/.cache/torch_extensions
|
| 35 |
+
if [ $# -eq 0 ]; then
|
| 36 |
+
ci_command="python tests/run.py --subprocess"
|
| 37 |
+
else
|
| 38 |
+
ci_command="$@"
|
| 39 |
+
fi
|
| 40 |
+
echo "Running case with command: $ci_command"
|
| 41 |
+
$ci_command
|