ybbwcwaps
some FakeVD
b0c0f32
raw
history blame
726 Bytes
from modelscope.pipelines import pipeline
from modelscope.utils.constant import Tasks
# ./FakeVD/Models/speech_paraformer-large-vad-punc_asr_nat-zh-cn-16k-common-vocab8404-pytorch/
# damo/speech_paraformer-large-vad-punc_asr_nat-zh-cn-16k-common-vocab8404-pytorch
class wav2text:
def __init__(self) -> None:
self.model = pipeline('auto-speech-recognition',
'./FakeVD/Models/speech_paraformer-large-vad-punc_asr_nat-zh-cn-16k-common-vocab8404-pytorch/', device="cpu")
def work(self, wav_path):
return self.model(wav_path,)
if __name__ == "__main__":
model = wav2text()
result = model.work('./FakeVD/dataset/videos_1/douyin_6671891732524829965.mp4')
print(result)