Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tests/engine/test_load.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
@pytest.mark.parametrize(
"model_name, expected_output, should_raise",
[
("PrunaAI/test-load-tiny-stable-diffusion-pipe-smashed", "PrunaModel", False),
("pruna-test/test-load-tiny-stable-diffusion-pipe-smashed", "PrunaModel", False),
("NonExistentRepo/model", None, True),
],
)
Expand Down
7 changes: 2 additions & 5 deletions tests/engine/test_save.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,12 @@
from pruna.engine.pruna_model import PrunaModel



@pytest.mark.skipif("HF_TOKEN" not in os.environ, reason="HF_TOKEN environment variable is not set, skipping tests.")
@pytest.mark.slow
@pytest.mark.cpu
def test_save_llm_to_hub() -> None:
"""Test saving an LLM model to the Hugging Face Hub."""
download_repo_id = "hf-internal-testing/tiny-random-llama4"
upload_repo_id = "PrunaAI/test-save-tiny-random-llama4-smashed"
upload_repo_id = "pruna-test/test-save-tiny-random-llama4-smashed"
model = AutoModelForCausalLM.from_pretrained(download_repo_id)
smash_config = SmashConfig(device="cpu")
pruna_model = smash(
Expand All @@ -31,13 +29,12 @@ def test_save_llm_to_hub() -> None:
)
pruna_model.push_to_hub(upload_repo_id, private=False)

@pytest.mark.skipif("HF_TOKEN" not in os.environ, reason="HF_TOKEN environment variable is not set, skipping tests.")
@pytest.mark.slow
@pytest.mark.cpu
def test_save_diffusers_to_hub() -> None:
"""Test saving a diffusers model to the Hugging Face Hub."""
download_repo_id = "hf-internal-testing/tiny-stable-diffusion-pipe"
upload_repo_id = "PrunaAI/test-save-tiny-stable-diffusion-pipe-smashed"
upload_repo_id = "pruna-test/test-save-tiny-stable-diffusion-pipe-smashed"
model = DiffusionPipeline.from_pretrained(download_repo_id)
smash_config = SmashConfig(device="cpu")
pruna_model = smash(
Expand Down
10 changes: 5 additions & 5 deletions tests/fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def dataloader_fixture(request: pytest.FixtureRequest) -> Any:

def whisper_tiny_random_model() -> tuple[Any, SmashConfig]:
"""Whisper tiny random model for speech recognition."""
model_id = "PrunaAI/whisper-v3-tiny-random"
model_id = "pruna-test/whisper-v3-tiny-random"
model = pipeline(
"automatic-speech-recognition",
model=model_id,
Expand Down Expand Up @@ -181,8 +181,8 @@ def get_automodel_image_text_to_text_transformers(model_id: str) -> tuple[Any, S
),
"dummy_lambda": dummy_model,
# image generation AR models
"tiny_janus_pro": partial(get_automodel_image_text_to_text_transformers, "loulou2/tiny_janus"),
"wan_tiny_random": partial(get_diffusers_model, "PrunaAI/wan-t2v-tiny-random", torch_dtype=torch.bfloat16),
"flux_tiny": partial(get_diffusers_model, "loulou2/tiny_flux", torch_dtype=torch.float16),
"tiny_llama": partial(get_automodel_transformers, "loulou2/tiny_llama", torch_dtype=torch.bfloat16),
"tiny_janus_pro": partial(get_automodel_image_text_to_text_transformers, "pruna-test/tiny_janus"),
"wan_tiny_random": partial(get_diffusers_model, "pruna-test/wan-t2v-tiny-random", torch_dtype=torch.bfloat16),
"flux_tiny": partial(get_diffusers_model, "pruna-test/tiny_flux", torch_dtype=torch.float16),
"tiny_llama": partial(get_automodel_transformers, "pruna-test/tiny_llama", torch_dtype=torch.bfloat16),
}