mirror of
https://github.com/huggingface/diffusers.git
synced 2026-04-23 08:01:26 +08:00
[tests] fix autoencoderdc tests (#13424)
* fix autoencoderdc tests * up
This commit is contained in:
@@ -28,6 +28,10 @@ enable_full_determinism()
|
||||
|
||||
|
||||
class AutoencoderDCTesterConfig(BaseModelTesterConfig):
|
||||
@property
|
||||
def main_input_name(self):
|
||||
return "sample"
|
||||
|
||||
@property
|
||||
def model_class(self):
|
||||
return AutoencoderDC
|
||||
@@ -77,6 +81,12 @@ class AutoencoderDCTesterConfig(BaseModelTesterConfig):
|
||||
class TestAutoencoderDC(AutoencoderDCTesterConfig, ModelTesterMixin):
|
||||
base_precision = 1e-2
|
||||
|
||||
@pytest.mark.parametrize("dtype", [torch.float16, torch.bfloat16], ids=["fp16", "bf16"])
|
||||
def test_from_save_pretrained_dtype_inference(self, tmp_path, dtype):
|
||||
if dtype == torch.bfloat16 and IS_GITHUB_ACTIONS:
|
||||
pytest.skip("Skipping bf16 test inside GitHub Actions environment")
|
||||
super().test_from_save_pretrained_dtype_inference(tmp_path, dtype)
|
||||
|
||||
|
||||
class TestAutoencoderDCTraining(AutoencoderDCTesterConfig, TrainingTesterMixin):
|
||||
"""Training tests for AutoencoderDC."""
|
||||
|
||||
Reference in New Issue
Block a user