Skip to content

[CI]add scripts for unittest #8433

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions scripts/unit_test/ci_unit.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
#!/usr/bin/env bash

# Copyright (c) 2024 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

export paddle=$1
export nlp_dir=/workspace/PaddleNLP
cd $nlp_dir

if [ ! -d "unittest_logs" ];then
mkdir unittest_logs
fi

install_requirements() {
python -m pip install -r requirements.txt
python -m pip install -r requirements-dev.txt
python -m pip install -r paddlenlp/experimental/autonlp/requirements.txt
python -m pip uninstall paddlepaddle -y
python -m pip install --no-cache-dir ${paddle}
python -m pip install sacremoses
python -m pip install parameterized
python -m pip install loguru==0.6.0
python -m pip install h5py
python -m pip install paddleslim

python setup.py bdist_wheel
python -m pip install dist/p****.whl
cd csrc/
python setup_cuda.py install
cd ../

pip list
}

set_env() {
export NVIDIA_TF32_OVERRIDE=0
export FLAGS_cudnn_deterministic=1
export HF_ENDPOINT=https://hf-mirror.com
}

install_requirements
set_env
pytest -v -n 8 --durations 20 --cov paddlenlp --cov-report xml:coverage.xml
Loading