Skip to content

Commit

Permalink
TST Use different diffusion model for testing
Browse files Browse the repository at this point in the history
So far, tests are using hf-internal-testing/tiny-stable-diffusion-torch
for testing diffusion models. However, this model has some issues:

- still uses pickle (.bin) instead of safetensors
- there is a FutureWarning because of the config

Now, using hf-internal-testing/tiny-sd-pipe instead which doesn't have
those issues.

On top of that, there is often a Hub error when loading the diffusion
model, although it's unclear why this particular model is so prone to
that. Maybe the new model eschews this error, but even if it doesn't, it
is better to make the switch.
  • Loading branch information
BenjaminBossan committed Jan 23, 2025
1 parent 6e30991 commit 83852ac
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tests/test_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ def test_scaling_set_to_zero(self, tokenizer):
assert torch.allclose(logits_base_model, logits_lora_model)

def test_diffusers_pipeline(self):
model_id = "hf-internal-testing/tiny-stable-diffusion-torch"
model_id = "hf-internal-testing/tiny-sd-pipe"
pipeline = StableDiffusionPipeline.from_pretrained(model_id)

text_encoder_kwargs = {
Expand Down
2 changes: 1 addition & 1 deletion tests/test_stablediffusion.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
from .testing_utils import temp_seed


PEFT_DIFFUSERS_SD_MODELS_TO_TEST = ["hf-internal-testing/tiny-stable-diffusion-torch"]
PEFT_DIFFUSERS_SD_MODELS_TO_TEST = ["hf-internal-testing/tiny-sd-pipe"]
CONFIG_TESTING_KWARGS = (
{
"text_encoder": {
Expand Down
2 changes: 1 addition & 1 deletion tests/test_tuners_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ def test_maybe_include_all_linear_layers_internals(self, initial_target_modules,
assert new_config.target_modules == expected_target_modules

def test_maybe_include_all_linear_layers_diffusion(self):
model_id = "hf-internal-testing/tiny-stable-diffusion-torch"
model_id = "hf-internal-testing/tiny-sd-pipe"
model = StableDiffusionPipeline.from_pretrained(model_id)
config = LoraConfig(base_model_name_or_path=model_id, target_modules="all-linear")

Expand Down

0 comments on commit 83852ac

Please sign in to comment.