Skip to content

Commit 9856f79

Browse files
[tests] add transformers & diffusers integration tests (#962)
* add transformers integration tests * add diffusers * test also on transformers release * adapt from suggestions * suggestions
1 parent 634bd19 commit 9856f79

File tree

1 file changed

+79
-0
lines changed

1 file changed

+79
-0
lines changed
+79
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
name: integration tests
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
branch:
7+
description: 'Branch to test on'
8+
required: true
9+
10+
jobs:
11+
run_transformers_integration_tests:
12+
strategy:
13+
matrix:
14+
transformers-version: ['main', 'latest']
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
with:
19+
ref: ${{ github.event.inputs.branch }}
20+
repository: ${{ github.event.pull_request.head.repo.full_name }}
21+
- name: Set up Python
22+
uses: actions/setup-python@v4
23+
with:
24+
python-version: "3.10"
25+
cache: "pip"
26+
cache-dependency-path: "setup.py"
27+
- name: print environment variables
28+
run: |
29+
echo "env.CI_BRANCH = ${{ env.CI_BRANCH }}"
30+
echo "env.CI_SHA = ${{ env.CI_SHA }}"
31+
- name: Install dependencies
32+
run: |
33+
python -m pip install --upgrade pip
34+
python -m pip install .[test]
35+
cd .. && git clone https://github.com/huggingface/transformers.git && cd transformers/ && git log
36+
if [ "${{ matrix.transformers-version }}" == "main" ]; then
37+
pip install -e ".[dev]"
38+
else
39+
echo "Nothing to do as transformers latest already installed"
40+
fi
41+
42+
- name: Test transformers integration
43+
run: |
44+
RUN_SLOW=1 pytest tests/peft_integration/test_peft_integration.py
45+
run_diffusers_integration_tests:
46+
strategy:
47+
matrix:
48+
# For now diffusers integration is not on PyPI
49+
diffusers-version: ['main']
50+
runs-on: ubuntu-latest
51+
steps:
52+
- uses: actions/checkout@v4
53+
with:
54+
ref: ${{ github.event.inputs.branch }}
55+
repository: ${{ github.event.pull_request.head.repo.full_name }}
56+
- name: Set up Python
57+
uses: actions/setup-python@v4
58+
with:
59+
python-version: "3.10"
60+
cache: "pip"
61+
cache-dependency-path: "setup.py"
62+
- name: print environment variables
63+
run: |
64+
echo "env.CI_BRANCH = ${{ env.CI_BRANCH }}"
65+
echo "env.CI_SHA = ${{ env.CI_SHA }}"
66+
- name: Install dependencies
67+
run: |
68+
python -m pip install --upgrade pip
69+
python -m pip install .[test]
70+
cd .. && git clone https://github.com/huggingface/diffusers.git && cd diffusers/ && git log
71+
if [ "${{ matrix.diffusers-version }}" == "main" ]; then
72+
pip install -e ".[dev]"
73+
else
74+
echo "Nothing to do as diffusers latest already installed"
75+
fi
76+
77+
- name: Test diffusers integration
78+
run: |
79+
pytest tests/lora/test_lora_layers_peft.py

0 commit comments

Comments
 (0)