|
|
@ -285,8 +285,10 @@ class VectorExecutor(BaseExecutor):
|
|
|
|
Defaults to None.
|
|
|
|
Defaults to None.
|
|
|
|
ckpt_path (Optional[os.PathLike], optional): the pretrained model path, which is stored in the disk.
|
|
|
|
ckpt_path (Optional[os.PathLike], optional): the pretrained model path, which is stored in the disk.
|
|
|
|
Defaults to None.
|
|
|
|
Defaults to None.
|
|
|
|
|
|
|
|
task (str, optional): the model task type
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
# stage 0: avoid to init the mode again
|
|
|
|
# stage 0: avoid to init the mode again
|
|
|
|
|
|
|
|
self.task = task
|
|
|
|
if hasattr(self, "model"):
|
|
|
|
if hasattr(self, "model"):
|
|
|
|
logger.info("Model has been initialized")
|
|
|
|
logger.info("Model has been initialized")
|
|
|
|
return
|
|
|
|
return
|
|
|
@ -435,6 +437,7 @@ class VectorExecutor(BaseExecutor):
|
|
|
|
if self.sample_rate != 16000 and self.sample_rate != 8000:
|
|
|
|
if self.sample_rate != 16000 and self.sample_rate != 8000:
|
|
|
|
logger.error(
|
|
|
|
logger.error(
|
|
|
|
"invalid sample rate, please input --sr 8000 or --sr 16000")
|
|
|
|
"invalid sample rate, please input --sr 8000 or --sr 16000")
|
|
|
|
|
|
|
|
logger.error(f"The model sample rate: {self.sample_rate}, the external sample rate is: {sample_rate}")
|
|
|
|
return False
|
|
|
|
return False
|
|
|
|
|
|
|
|
|
|
|
|
if isinstance(audio_file, (str, os.PathLike)):
|
|
|
|
if isinstance(audio_file, (str, os.PathLike)):
|
|
|
|