def test_create_generator_from_audio_files(deepspeech: DeepSpeech): generator = deepspeech.create_generator(file_path='tests/data/audio.csv', source='from_audio_files', batch_size=2) assert len(generator) == 2 X, y = generator[0] assert X.shape == (2, 739, 26) assert y.shape == (2, 206)
def test_create_generator_from_prepared_features(deepspeech: DeepSpeech): generator = deepspeech.create_generator( file_path='tests/data/features.hdf5', source='from_prepared_features', batch_size=2) assert len(generator) == 6 X, y = generator[0] assert X.shape == (2, 93, 26) assert y.shape == (2, 39)
def generator(deepspeech: DeepSpeech) -> DataGenerator: return deepspeech.create_generator(file_path='tests/data/features.hdf5', source='from_prepared_features', batch_size=2)