Open lonngxiang opened 10 months ago
能指定下载的离线模型吗
from paddlespeech.cli.vector import VectorExecutor
import paddle
vector_executor = VectorExecutor()
audio_emb = vector_executor(
model='ecapatdnn_voxceleb12',
sample_rate=16000,
config=None, # Set `config` and `ckpt_path` to None to use pretrained model.
ckpt_path=None,
audio_file=r'C:*36145389.wav',
device=paddle.get_device())
print('Audio embedding Result: \n{}'.format(audio_emb))
配置说明,源码里有:
即使用ckpt_path
、config
两个参数配置
比如下载的模型文件,如下:
可以根据需要将模型文件移动到指定路径下,如/nfs/models/
,代码如下:
ckpt_path
、config
两个参数
audio_emb = vector_executor(
model='ecapatdnn_voxceleb12',
sample_rate=16000,
config=None, # Set `config` and `ckpt_path` to None to use pretrained model.
ckpt_path=None,
audio_file=r'C:*36145389.wav',
device=paddle.get_device()),
ckpt_path="/nfs/models/sv0_ecapa_tdnn_voxceleb12_ckpt_0_1_2/model/model",
config="/nfs/models/sv0_ecapa_tdnn_voxceleb12_ckpt_0_1_2/conf/model.yaml"
注意:`ckpt_path`必须为`***/xxx/model",因为源码中会有进一步的处理
```python
os.path.abspath(ckpt_path + ".pdparams")
声纹识别能制定加载离线模型路径吗