Use small config for OneFormerModelTest.test_model_with_labels (#25383)
fix Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
This commit is contained in:
@@ -285,7 +285,7 @@ torch_job = CircleCIJob(
|
|||||||
"pip install -U --upgrade-strategy eager git+https://github.com/huggingface/accelerate",
|
"pip install -U --upgrade-strategy eager git+https://github.com/huggingface/accelerate",
|
||||||
],
|
],
|
||||||
parallelism=1,
|
parallelism=1,
|
||||||
pytest_num_workers=6,
|
pytest_num_workers=8,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -332,13 +332,13 @@ class OneFormerModelTest(ModelTesterMixin, PipelineTesterMixin, unittest.TestCas
|
|||||||
"pixel_values": torch.randn((2, 3, *size), device=torch_device),
|
"pixel_values": torch.randn((2, 3, *size), device=torch_device),
|
||||||
"task_inputs": torch.randint(high=self.model_tester.vocab_size, size=(2, 77), device=torch_device).long(),
|
"task_inputs": torch.randint(high=self.model_tester.vocab_size, size=(2, 77), device=torch_device).long(),
|
||||||
"text_inputs": torch.randint(
|
"text_inputs": torch.randint(
|
||||||
high=self.model_tester.vocab_size, size=(2, 134, 77), device=torch_device
|
high=self.model_tester.vocab_size, size=(2, 6, 77), device=torch_device
|
||||||
).long(),
|
).long(),
|
||||||
"mask_labels": torch.randn((2, 150, *size), device=torch_device),
|
"mask_labels": torch.randn((2, 150, *size), device=torch_device),
|
||||||
"class_labels": torch.zeros(2, 150, device=torch_device).long(),
|
"class_labels": torch.zeros(2, 150, device=torch_device).long(),
|
||||||
}
|
}
|
||||||
|
|
||||||
config = OneFormerConfig()
|
config = self.model_tester.get_config()
|
||||||
config.is_training = True
|
config.is_training = True
|
||||||
|
|
||||||
model = OneFormerForUniversalSegmentation(config).to(torch_device)
|
model = OneFormerForUniversalSegmentation(config).to(torch_device)
|
||||||
|
|||||||
Reference in New Issue
Block a user