Skip to content

Commit

Permalink
test num images
Browse files Browse the repository at this point in the history
  • Loading branch information
IlyasMoutawwakil committed Nov 4, 2024
1 parent d22382c commit a77549c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/test_onnxruntime.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,18 @@ jobs:
run: |
pip install --upgrade pip
pip install --no-cache-dir torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
pip install .[tests,onnxruntime]
pip install .[tests,onnxruntime] transformers[testing]
- if: ${{ matrix.transformers-version != 'latest' }}
name: Downgrade Transformers
run: pip install transformers==${{ matrix.transformers-version }}

- name: Test with pytest (in series)
run: |
pytest tests/onnxruntime -m "run_in_series" --durations=0 -vvvv -s
pytest tests/onnxruntime -m "run_in_series" --durations=0
- name: Test with pytest (in parallel)
run: |
pytest tests/onnxruntime -m "not run_in_series" --durations=0 -vvvv -s -n auto
pytest tests/onnxruntime -m "not run_in_series" --durations=0 -n auto -k "test_num_images_per_prompt"
env:
HF_HUB_READ_TOKEN: ${{ secrets.HF_HUB_READ_TOKEN }}
12 changes: 6 additions & 6 deletions tests/onnxruntime/test_diffusion.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@ def test_num_images_per_prompt(self, model_arch: str):
pipeline = self.ORTMODEL_CLASS.from_pretrained(self.onnx_model_dirs[model_arch])

for batch_size in [1, 3]:
for height in [64, 128]:
for width in [64, 128]:
for height in [16, 32]:
for width in [16, 32]:
for num_images_per_prompt in [1, 3]:
inputs = self.generate_inputs(height=height, width=width, batch_size=batch_size)
outputs = pipeline(**inputs, num_images_per_prompt=num_images_per_prompt).images
Expand Down Expand Up @@ -379,8 +379,8 @@ def test_num_images_per_prompt(self, model_arch: str):
pipeline = self.ORTMODEL_CLASS.from_pretrained(self.onnx_model_dirs[model_arch])

for batch_size in [1, 3]:
for height in [64, 128]:
for width in [64, 128]:
for height in [16, 32]:
for width in [16, 32]:
for num_images_per_prompt in [1, 3]:
inputs = self.generate_inputs(height=height, width=width, batch_size=batch_size)
outputs = pipeline(**inputs, num_images_per_prompt=num_images_per_prompt).images
Expand Down Expand Up @@ -611,8 +611,8 @@ def test_num_images_per_prompt(self, model_arch: str):
pipeline = self.ORTMODEL_CLASS.from_pretrained(self.onnx_model_dirs[model_arch])

for batch_size in [1, 3]:
for height in [64, 128]:
for width in [64, 128]:
for height in [16, 32]:
for width in [16, 32]:
for num_images_per_prompt in [1, 3]:
inputs = self.generate_inputs(height=height, width=width, batch_size=batch_size)
outputs = pipeline(**inputs, num_images_per_prompt=num_images_per_prompt).images
Expand Down

0 comments on commit a77549c

Please sign in to comment.