mirror of
https://github.com/finegrain-ai/refiners.git
synced 2024-11-24 15:18:46 +00:00
call GC between each e2e test to avoid OOM
This commit is contained in:
parent
5a8389ee0d
commit
19bc081658
|
@ -1,3 +1,4 @@
|
|||
import gc
|
||||
from pathlib import Path
|
||||
from typing import Iterator
|
||||
from warnings import warn
|
||||
|
@ -30,6 +31,13 @@ from refiners.foundationals.latent_diffusion.stable_diffusion_xl.model import St
|
|||
from tests.utils import ensure_similar_images
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def ensure_gc():
|
||||
# Avoid GPU OOMs
|
||||
# See https://github.com/pytest-dev/pytest/discussions/8153#discussioncomment-214812
|
||||
gc.collect()
|
||||
|
||||
|
||||
@pytest.fixture(scope="module")
|
||||
def ref_path(test_e2e_path: Path) -> Path:
|
||||
return test_e2e_path / "test_diffusion_ref"
|
||||
|
|
Loading…
Reference in a new issue