Add class properties with warnings (#21195)
* Replace reduce_labels with do_reduce_labels * Replace only for __init__ and preprocess * Add class properties with warnings * Update tests
This commit is contained in:
@@ -353,7 +353,7 @@ class BeitImageProcessingTest(ImageProcessingSavingTestMixin, unittest.TestCase)
|
||||
self.assertTrue(encoding["labels"].min().item() >= 0)
|
||||
self.assertTrue(encoding["labels"].max().item() <= 150)
|
||||
|
||||
image_processing.reduce_labels = True
|
||||
image_processing.do_reduce_labels = True
|
||||
encoding = image_processing(image, map, return_tensors="pt")
|
||||
self.assertTrue(encoding["labels"].min().item() >= 0)
|
||||
self.assertTrue(encoding["labels"].max().item() <= 255)
|
||||
|
||||
Reference in New Issue
Block a user