mirror of
https://github.com/modelscope/FunASR
synced 2025-09-15 14:48:36 +08:00
update
This commit is contained in:
parent
7f7c23c36f
commit
0237e32625
@ -3,8 +3,8 @@
|
|||||||
. ./path.sh || exit 1;
|
. ./path.sh || exit 1;
|
||||||
|
|
||||||
# machines configuration
|
# machines configuration
|
||||||
CUDA_VISIBLE_DEVICES="0"
|
CUDA_VISIBLE_DEVICES="0,1"
|
||||||
gpu_num=1
|
gpu_num=2
|
||||||
count=1
|
count=1
|
||||||
gpu_inference=true # Whether to perform gpu decoding, set false for cpu decoding
|
gpu_inference=true # Whether to perform gpu decoding, set false for cpu decoding
|
||||||
# for gpu decoding, inference_nj=ngpu*njob; for cpu decoding, inference_nj=njob
|
# for gpu decoding, inference_nj=ngpu*njob; for cpu decoding, inference_nj=njob
|
||||||
|
|||||||
@ -111,6 +111,7 @@ class ESPnetDataset(Dataset):
|
|||||||
int_dtype: str = "long",
|
int_dtype: str = "long",
|
||||||
dest_sample_rate: int = 16000,
|
dest_sample_rate: int = 16000,
|
||||||
speed_perturb: tuple = None,
|
speed_perturb: tuple = None,
|
||||||
|
mode: str = "train",
|
||||||
):
|
):
|
||||||
assert check_argument_types()
|
assert check_argument_types()
|
||||||
if len(path_name_type_list) == 0:
|
if len(path_name_type_list) == 0:
|
||||||
@ -125,6 +126,7 @@ class ESPnetDataset(Dataset):
|
|||||||
self.int_dtype = int_dtype
|
self.int_dtype = int_dtype
|
||||||
self.dest_sample_rate = dest_sample_rate
|
self.dest_sample_rate = dest_sample_rate
|
||||||
self.speed_perturb = speed_perturb
|
self.speed_perturb = speed_perturb
|
||||||
|
self.mode = mode
|
||||||
|
|
||||||
self.loader_dict = {}
|
self.loader_dict = {}
|
||||||
self.debug_info = {}
|
self.debug_info = {}
|
||||||
@ -148,7 +150,8 @@ class ESPnetDataset(Dataset):
|
|||||||
loader_type: loader_type. sound, npy, text, etc
|
loader_type: loader_type. sound, npy, text, etc
|
||||||
"""
|
"""
|
||||||
if loader_type == "sound":
|
if loader_type == "sound":
|
||||||
loader = SoundScpReader(path, self.dest_sample_rate, normalize=True, always_2d=False, speed_perturb=self.speed_perturb)
|
speed_perturb = self.speed_perturb if self.mode == "train" else None
|
||||||
|
loader = SoundScpReader(path, self.dest_sample_rate, normalize=True, always_2d=False, speed_perturb=speed_perturb)
|
||||||
return AdapterForSoundScpReader(loader, self.float_dtype)
|
return AdapterForSoundScpReader(loader, self.float_dtype)
|
||||||
elif loader_type == "kaldi_ark":
|
elif loader_type == "kaldi_ark":
|
||||||
loader = kaldiio.load_scp(path)
|
loader = kaldiio.load_scp(path)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user