[tests] fix "Tester object has no attribute '_testMethodName'" (#34910)
* add more cases * fix method not found in unittest Signed-off-by: Lin, Fanli <fanli.lin@intel.com> * fix more cases * add more models * add all * no unittest.case * remove for oneformer * fix style --------- Signed-off-by: Lin, Fanli <fanli.lin@intel.com>
This commit is contained in:
@@ -50,7 +50,7 @@ def floats_list(shape, scale=1.0, rng=None, name=None):
|
|||||||
return values
|
return values
|
||||||
|
|
||||||
|
|
||||||
class ASTFeatureExtractionTester(unittest.TestCase):
|
class ASTFeatureExtractionTester:
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
parent,
|
parent,
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ if is_vision_available():
|
|||||||
from transformers import BeitImageProcessor
|
from transformers import BeitImageProcessor
|
||||||
|
|
||||||
|
|
||||||
class BeitImageProcessingTester(unittest.TestCase):
|
class BeitImageProcessingTester:
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
parent,
|
parent,
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ def floats_list(shape, scale=1.0, rng=None, name=None):
|
|||||||
@require_torch
|
@require_torch
|
||||||
@require_torchaudio
|
@require_torchaudio
|
||||||
# Copied from tests.models.whisper.test_feature_extraction_whisper.WhisperFeatureExtractionTester with Whisper->Clap
|
# Copied from tests.models.whisper.test_feature_extraction_whisper.WhisperFeatureExtractionTester with Whisper->Clap
|
||||||
class ClapFeatureExtractionTester(unittest.TestCase):
|
class ClapFeatureExtractionTester:
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
parent,
|
parent,
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ if is_vision_available():
|
|||||||
from transformers import CLIPImageProcessor
|
from transformers import CLIPImageProcessor
|
||||||
|
|
||||||
|
|
||||||
class CLIPImageProcessingTester(unittest.TestCase):
|
class CLIPImageProcessingTester:
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
parent,
|
parent,
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ def floats_list(shape, scale=1.0, rng=None, name=None):
|
|||||||
|
|
||||||
|
|
||||||
@require_torch
|
@require_torch
|
||||||
class ClvpFeatureExtractionTester(unittest.TestCase):
|
class ClvpFeatureExtractionTester:
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
parent,
|
parent,
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ if is_vision_available():
|
|||||||
from transformers import ConditionalDetrImageProcessor
|
from transformers import ConditionalDetrImageProcessor
|
||||||
|
|
||||||
|
|
||||||
class ConditionalDetrImageProcessingTester(unittest.TestCase):
|
class ConditionalDetrImageProcessingTester:
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
parent,
|
parent,
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ def floats_list(shape, scale=1.0, rng=None, name=None):
|
|||||||
|
|
||||||
@require_torch
|
@require_torch
|
||||||
# Copied from transformers.tests.encodec.test_feature_extraction_dac.EncodecFeatureExtractionTester with Encodec->Dac
|
# Copied from transformers.tests.encodec.test_feature_extraction_dac.EncodecFeatureExtractionTester with Encodec->Dac
|
||||||
class DacFeatureExtractionTester(unittest.TestCase):
|
class DacFeatureExtractionTester:
|
||||||
# Ignore copy
|
# Ignore copy
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ def floats_list(shape, scale=1.0, rng=None, name=None):
|
|||||||
|
|
||||||
|
|
||||||
@require_torch
|
@require_torch
|
||||||
class EnCodecFeatureExtractionTester(unittest.TestCase):
|
class EnCodecFeatureExtractionTester:
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
parent,
|
parent,
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ if is_vision_available():
|
|||||||
from transformers import GroundingDinoImageProcessor
|
from transformers import GroundingDinoImageProcessor
|
||||||
|
|
||||||
|
|
||||||
class GroundingDinoImageProcessingTester(unittest.TestCase):
|
class GroundingDinoImageProcessingTester:
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
parent,
|
parent,
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ if is_vision_available():
|
|||||||
from transformers import IdeficsImageProcessor
|
from transformers import IdeficsImageProcessor
|
||||||
|
|
||||||
|
|
||||||
class IdeficsImageProcessingTester(unittest.TestCase):
|
class IdeficsImageProcessingTester:
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
parent,
|
parent,
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ if is_torch_available():
|
|||||||
import torch
|
import torch
|
||||||
|
|
||||||
|
|
||||||
class Idefics2ImageProcessingTester(unittest.TestCase):
|
class Idefics2ImageProcessingTester:
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
parent,
|
parent,
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ if is_vision_available():
|
|||||||
from transformers import LlavaNextImageProcessor
|
from transformers import LlavaNextImageProcessor
|
||||||
|
|
||||||
|
|
||||||
class LlavaNextImageProcessingTester(unittest.TestCase):
|
class LlavaNextImageProcessingTester:
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
parent,
|
parent,
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ if is_vision_available():
|
|||||||
from transformers import LlavaNextVideoImageProcessor
|
from transformers import LlavaNextVideoImageProcessor
|
||||||
|
|
||||||
|
|
||||||
class LlavaNextVideoProcessingTester(unittest.TestCase):
|
class LlavaNextVideoProcessingTester:
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
parent,
|
parent,
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ if is_vision_available():
|
|||||||
from transformers import LlavaOnevisionImageProcessor, LlavaOnevisionVideoProcessor
|
from transformers import LlavaOnevisionImageProcessor, LlavaOnevisionVideoProcessor
|
||||||
|
|
||||||
|
|
||||||
class LlavaOnevisionImageProcessingTester(unittest.TestCase):
|
class LlavaOnevisionImageProcessingTester:
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
parent,
|
parent,
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ if is_bs4_available():
|
|||||||
from transformers import MarkupLMFeatureExtractor
|
from transformers import MarkupLMFeatureExtractor
|
||||||
|
|
||||||
|
|
||||||
class MarkupLMFeatureExtractionTester(unittest.TestCase):
|
class MarkupLMFeatureExtractionTester:
|
||||||
def __init__(self, parent):
|
def __init__(self, parent):
|
||||||
self.parent = parent
|
self.parent = parent
|
||||||
|
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ if is_vision_available():
|
|||||||
from PIL import Image
|
from PIL import Image
|
||||||
|
|
||||||
|
|
||||||
class Mask2FormerImageProcessingTester(unittest.TestCase):
|
class Mask2FormerImageProcessingTester:
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
parent,
|
parent,
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ if is_vision_available():
|
|||||||
from PIL import Image
|
from PIL import Image
|
||||||
|
|
||||||
|
|
||||||
class MaskFormerImageProcessingTester(unittest.TestCase):
|
class MaskFormerImageProcessingTester:
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
parent,
|
parent,
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ def get_bip_bip(bip_duration=0.125, duration=0.5, sample_rate=32000):
|
|||||||
|
|
||||||
@require_torch
|
@require_torch
|
||||||
@require_torchaudio
|
@require_torchaudio
|
||||||
class MusicgenMelodyFeatureExtractionTester(unittest.TestCase):
|
class MusicgenMelodyFeatureExtractionTester:
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
parent,
|
parent,
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ if is_vision_available():
|
|||||||
from PIL import Image
|
from PIL import Image
|
||||||
|
|
||||||
|
|
||||||
class OneFormerImageProcessorTester(unittest.TestCase):
|
class OneFormerImageProcessorTester:
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
parent,
|
parent,
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ def prepare_metadata(class_info_file, repo_path="shi-labs/oneformer_demo"):
|
|||||||
return metadata
|
return metadata
|
||||||
|
|
||||||
|
|
||||||
class OneFormerProcessorTester(unittest.TestCase):
|
class OneFormerProcessorTester:
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
parent,
|
parent,
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ if is_vision_available():
|
|||||||
from transformers import Pix2StructImageProcessor
|
from transformers import Pix2StructImageProcessor
|
||||||
|
|
||||||
|
|
||||||
class Pix2StructImageProcessingTester(unittest.TestCase):
|
class Pix2StructImageProcessingTester:
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
parent,
|
parent,
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ if is_vision_available():
|
|||||||
from transformers import PixtralImageProcessorFast
|
from transformers import PixtralImageProcessorFast
|
||||||
|
|
||||||
|
|
||||||
class PixtralImageProcessingTester(unittest.TestCase):
|
class PixtralImageProcessingTester:
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
parent,
|
parent,
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ if requirements_available:
|
|||||||
from transformers import Pop2PianoFeatureExtractor
|
from transformers import Pop2PianoFeatureExtractor
|
||||||
|
|
||||||
|
|
||||||
class Pop2PianoFeatureExtractionTester(unittest.TestCase):
|
class Pop2PianoFeatureExtractionTester:
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
parent,
|
parent,
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ if is_vision_available():
|
|||||||
from transformers import Qwen2VLImageProcessor
|
from transformers import Qwen2VLImageProcessor
|
||||||
|
|
||||||
|
|
||||||
class Qwen2VLImageProcessingTester(unittest.TestCase):
|
class Qwen2VLImageProcessingTester:
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
parent,
|
parent,
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ def floats_list(shape, scale=1.0, rng=None, name=None):
|
|||||||
|
|
||||||
|
|
||||||
@require_torch
|
@require_torch
|
||||||
class SeamlessM4TFeatureExtractionTester(unittest.TestCase):
|
class SeamlessM4TFeatureExtractionTester:
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
parent,
|
parent,
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ if is_vision_available():
|
|||||||
from transformers import SegformerImageProcessor
|
from transformers import SegformerImageProcessor
|
||||||
|
|
||||||
|
|
||||||
class SegformerImageProcessingTester(unittest.TestCase):
|
class SegformerImageProcessingTester:
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
parent,
|
parent,
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ if is_vision_available():
|
|||||||
from transformers import SegGptImageProcessor
|
from transformers import SegGptImageProcessor
|
||||||
|
|
||||||
|
|
||||||
class SegGptImageProcessingTester(unittest.TestCase):
|
class SegGptImageProcessingTester:
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
parent,
|
parent,
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ def floats_list(shape, scale=1.0, rng=None, name=None):
|
|||||||
|
|
||||||
@require_torch
|
@require_torch
|
||||||
@require_torchaudio
|
@require_torchaudio
|
||||||
class Speech2TextFeatureExtractionTester(unittest.TestCase):
|
class Speech2TextFeatureExtractionTester:
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
parent,
|
parent,
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ def floats_list(shape, scale=1.0, rng=None, name=None):
|
|||||||
|
|
||||||
|
|
||||||
@require_torch
|
@require_torch
|
||||||
class SpeechT5FeatureExtractionTester(unittest.TestCase):
|
class SpeechT5FeatureExtractionTester:
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
parent,
|
parent,
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ if is_vision_available():
|
|||||||
from transformers import SuperPointImageProcessor
|
from transformers import SuperPointImageProcessor
|
||||||
|
|
||||||
|
|
||||||
class SuperPointImageProcessingTester(unittest.TestCase):
|
class SuperPointImageProcessingTester:
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
parent,
|
parent,
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ def floats_list(shape, scale=1.0, rng=None, name=None):
|
|||||||
return values
|
return values
|
||||||
|
|
||||||
|
|
||||||
class UnivNetFeatureExtractionTester(unittest.TestCase):
|
class UnivNetFeatureExtractionTester:
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
parent,
|
parent,
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ def floats_list(shape, scale=1.0, rng=None, name=None):
|
|||||||
return values
|
return values
|
||||||
|
|
||||||
|
|
||||||
class Wav2Vec2FeatureExtractionTester(unittest.TestCase):
|
class Wav2Vec2FeatureExtractionTester:
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
parent,
|
parent,
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ def floats_list(shape, scale=1.0, rng=None, name=None):
|
|||||||
return values
|
return values
|
||||||
|
|
||||||
|
|
||||||
class WhisperFeatureExtractionTester(unittest.TestCase):
|
class WhisperFeatureExtractionTester:
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
parent,
|
parent,
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ if is_vision_available():
|
|||||||
from transformers import YolosImageProcessor
|
from transformers import YolosImageProcessor
|
||||||
|
|
||||||
|
|
||||||
class YolosImageProcessingTester(unittest.TestCase):
|
class YolosImageProcessingTester:
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
parent,
|
parent,
|
||||||
|
|||||||
Reference in New Issue
Block a user