Skip to content

Commit

Permalink
use small model for testing textual inversion (#1030)
Browse files Browse the repository at this point in the history
* use small model for testing textual inversion

* enable tests in precommit
  • Loading branch information
eaidova authored Nov 26, 2024
1 parent 0a9a10b commit da5903d
Showing 1 changed file with 6 additions and 23 deletions.
29 changes: 6 additions & 23 deletions tests/openvino/test_diffusion.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
from pathlib import Path

import numpy as np
import pytest
import torch
from diffusers import (
AutoPipelineForImage2Image,
Expand All @@ -28,7 +27,6 @@
from diffusers.pipelines.stable_diffusion import StableDiffusionSafetyChecker
from diffusers.utils import load_image
from parameterized import parameterized
from transformers.testing_utils import slow
from utils_tests import MODEL_NAMES, SEED

from optimum.intel.openvino import (
Expand Down Expand Up @@ -379,15 +377,10 @@ def test_height_width_properties(self, model_arch: str):
self.assertEqual(ov_pipeline.height, height)
self.assertEqual(ov_pipeline.width, width)

@pytest.mark.run_slow
@slow
@require_diffusers
def test_textual_inversion(self):
# for now we only test for stable-diffusion
# this is very slow and costly to run right now

model_id = "runwayml/stable-diffusion-v1-5"
ti_id = "sd-concepts-library/cat-toy"
model_id = "hf-internal-testing/tiny-stable-diffusion-torch"
ti_id = "katuni4ka/textual_inversion_cat"

inputs = self.generate_inputs()
inputs["prompt"] = "A <cat-toy> backpack"
Expand Down Expand Up @@ -623,15 +616,10 @@ def test_height_width_properties(self, model_arch: str):
self.assertEqual(ov_pipeline.height, height)
self.assertEqual(ov_pipeline.width, width)

@pytest.mark.run_slow
@slow
@require_diffusers
def test_textual_inversion(self):
# for now we only test for stable-diffusion
# this is very slow and costly to run right now

model_id = "runwayml/stable-diffusion-v1-5"
ti_id = "sd-concepts-library/cat-toy"
model_id = "hf-internal-testing/tiny-stable-diffusion-torch"
ti_id = "katuni4ka/textual_inversion_cat"

inputs = self.generate_inputs(model_type="stable-diffusion")
inputs["prompt"] = "A <cat-toy> backpack"
Expand Down Expand Up @@ -867,15 +855,10 @@ def test_height_width_properties(self, model_arch: str):
self.assertEqual(ov_pipeline.height, height)
self.assertEqual(ov_pipeline.width, width)

@pytest.mark.run_slow
@slow
@require_diffusers
def test_textual_inversion(self):
# for now we only test for stable-diffusion
# this is very slow and costly to run right now

model_id = "runwayml/stable-diffusion-v1-5"
ti_id = "sd-concepts-library/cat-toy"
model_id = "hf-internal-testing/tiny-stable-diffusion-torch"
ti_id = "katuni4ka/textual_inversion_cat"

inputs = self.generate_inputs()
inputs["prompt"] = "A <cat-toy> backpack"
Expand Down

0 comments on commit da5903d

Please sign in to comment.