forked from huggingface/trl
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into cgpo_mixture_of_judges
- Loading branch information
Showing
45 changed files
with
844 additions
and
839 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,90 +1,163 @@ | ||
name: tests | ||
name: Tests | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
paths: | ||
# Run only when relevant files are modified | ||
- "trl/**.py" | ||
- ".github/**.yml" | ||
- "examples/**.py" | ||
- "scripts/**.py" | ||
- ".github/**.yml" | ||
- "tests/**.py" | ||
- "trl/**.py" | ||
- "setup.py" | ||
|
||
env: | ||
TQDM_DISABLE: 1 | ||
CI_SLACK_CHANNEL: ${{ secrets.CI_PUSH_MAIN_CHANNEL }} | ||
|
||
jobs: | ||
check_code_quality: | ||
name: Check code quality | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: [3.9] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
submodules: recursive | ||
- name: Set up Python ${{ matrix.python-version }} | ||
- name: Set up Python 3.12 | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
python-version: 3.12 | ||
- uses: pre-commit/[email protected] | ||
with: | ||
extra_args: --all-files | ||
|
||
tests: | ||
needs: check_code_quality | ||
name: Tests | ||
strategy: | ||
matrix: | ||
python-version: ['3.9', '3.10', '3.11'] | ||
python-version: ['3.9', '3.10', '3.11', '3.12'] | ||
os: ['ubuntu-latest', 'windows-latest'] | ||
fail-fast: false | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
cache: "pip" | ||
cache-dependency-path: | | ||
setup.py | ||
requirements.txt | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
# install PEFT & transformers from source | ||
pip install -U git+https://github.com/huggingface/peft.git | ||
pip install -U git+https://github.com/huggingface/transformers.git | ||
# cpu version of pytorch | ||
pip install ".[test, diffusers]" | ||
- name: Test with pytest | ||
run: | | ||
make test | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
cache: "pip" | ||
cache-dependency-path: | | ||
setup.py | ||
requirements.txt | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install ".[dev]" | ||
- name: Test with pytest | ||
run: | | ||
make test | ||
- name: Post to Slack | ||
if: github.ref == 'refs/heads/main' && always() # Check if the branch is main | ||
uses: huggingface/hf-workflows/.github/actions/post-slack@main | ||
with: | ||
slack_channel: ${{ env.CI_SLACK_CHANNEL }} | ||
title: Results with ${{ matrix.python-version }} on ${{ matrix.os }} with lastest dependencies | ||
status: ${{ job.status }} | ||
slack_token: ${{ secrets.SLACK_CIFEEDBACK_BOT_TOKEN }} | ||
|
||
tests_no_optional_dep: | ||
needs: check_code_quality | ||
tests_dev: | ||
name: Tests with dev dependencies | ||
runs-on: 'ubuntu-latest' | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python 3.9 | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.9' | ||
cache: "pip" | ||
cache-dependency-path: | | ||
setup.py | ||
requirements.txt | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
# install transformers from source | ||
pip install -U git+https://github.com/huggingface/transformers.git | ||
# cpu version of pytorch | ||
pip install .[test] | ||
- name: Test with pytest | ||
run: | | ||
make test | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python 3.12 | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.12' | ||
cache: "pip" | ||
cache-dependency-path: | | ||
setup.py | ||
requirements.txt | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install -U git+https://github.com/huggingface/accelerate.git | ||
python -m pip install -U git+https://github.com/huggingface/datasets.git | ||
python -m pip install -U git+https://github.com/huggingface/transformers.git | ||
python -m pip install ".[dev]" | ||
- name: Test with pytest | ||
run: | | ||
make test | ||
- name: Post to Slack | ||
if: github.ref == 'refs/heads/main' && always() # Check if the branch is main | ||
uses: huggingface/hf-workflows/.github/actions/post-slack@main | ||
with: | ||
slack_channel: ${{ env.CI_SLACK_CHANNEL }} | ||
title: Results with ${{ matrix.python-version }} on ${{ matrix.os }} with dev dependencies | ||
status: ${{ job.status }} | ||
slack_token: ${{ secrets.SLACK_CIFEEDBACK_BOT_TOKEN }} | ||
|
||
tests_wo_optional_deps: | ||
name: Tests without optional dependencies | ||
runs-on: 'ubuntu-latest' | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python 3.12 | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.12' | ||
cache: "pip" | ||
cache-dependency-path: | | ||
setup.py | ||
requirements.txt | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install ".[test]" | ||
- name: Test with pytest | ||
run: | | ||
make test | ||
- name: Post to Slack | ||
if: github.ref == 'refs/heads/main' && always() # Check if the branch is main | ||
uses: huggingface/hf-workflows/.github/actions/post-slack@main | ||
with: | ||
slack_channel: ${{ env.CI_SLACK_CHANNEL }} | ||
title: Results with ${{ matrix.python-version }} on ${{ matrix.os }} without optional dependencies | ||
status: ${{ job.status }} | ||
slack_token: ${{ secrets.SLACK_CIFEEDBACK_BOT_TOKEN }} | ||
|
||
tests_min_versions: | ||
name: Tests with minimum versions | ||
runs-on: 'ubuntu-latest' | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python 3.12 | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.12' | ||
cache: "pip" | ||
cache-dependency-path: | | ||
setup.py | ||
requirements.txt | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install accelerate==0.34.0 | ||
python -m pip install datasets==2.21.0 | ||
python -m pip install transformers==4.46.0 | ||
python -m pip install ".[dev]" | ||
- name: Test with pytest | ||
run: | | ||
make test | ||
- name: Post to Slack | ||
if: github.ref == 'refs/heads/main' && always() # Check if the branch is main | ||
uses: huggingface/hf-workflows/.github/actions/post-slack@main | ||
with: | ||
slack_channel: ${{ env.CI_SLACK_CHANNEL }} | ||
title: Results with ${{ matrix.python-version }} on ${{ matrix.os }} with minimum versions | ||
status: ${{ job.status }} | ||
slack_token: ${{ secrets.SLACK_CIFEEDBACK_BOT_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,4 @@ | ||
datasets>=1.17.0 | ||
torch>=1.4.0 | ||
tqdm | ||
transformers>=4.46.0 | ||
accelerate | ||
peft>=0.3.0 | ||
tyro>=0.5.7 | ||
datasets | ||
rich | ||
transformers>=4.46.0 |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.