зеркало из https://github.com/mozilla/DeepSpeech.git
Only unpack when we need to, to make things work with SDBs
This commit is contained in:
Родитель
24e9e6777c
Коммит
6cb638211e
|
@ -120,7 +120,10 @@ class Sample:
|
|||
|
||||
def _unpack_and_change_audio_type(sample_and_audio_type):
|
||||
packed_sample, audio_type, bitrate = sample_and_audio_type
|
||||
sample = packed_sample.unpack()
|
||||
if hasattr(sample, 'unpack'):
|
||||
sample = packed_sample.unpack()
|
||||
else:
|
||||
sample = packed_sample
|
||||
sample.change_audio_type(audio_type, bitrate=bitrate)
|
||||
return sample
|
||||
|
||||
|
|
|
@ -152,7 +152,10 @@ def _init_augmentation_worker(preparation_context):
|
|||
|
||||
def _load_and_augment_sample(timed_sample, context=None):
|
||||
sample, clock = timed_sample
|
||||
realized_sample = sample.unpack()
|
||||
if hasattr(sample, 'unpack'):
|
||||
realized_sample = sample.unpack()
|
||||
else:
|
||||
realized_sample = sample
|
||||
return _augment_sample((realized_sample, clock), context)
|
||||
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче