mirror of
https://github.com/BoardWare-Genius/jarvis-models.git
synced 2025-12-13 16:53:24 +00:00
feat: asr blackblox
This commit is contained in:
18
src/asr/asr_service.py
Normal file
18
src/asr/asr_service.py
Normal file
@ -0,0 +1,18 @@
|
||||
import io
|
||||
import logging
|
||||
|
||||
from .rapid_paraformer import RapidParaformer
|
||||
from .rapid_paraformer.utils import read_yaml
|
||||
|
||||
class ASRService():
|
||||
|
||||
def __init__(self, config_path: str):
|
||||
config = read_yaml(config_path)
|
||||
print(config)
|
||||
logging.info('Initializing ASR Service...')
|
||||
self.paraformer = RapidParaformer(config)
|
||||
|
||||
def infer(self, wav_path):
|
||||
by = open(wav_path, 'rb')
|
||||
result = self.paraformer([io.BytesIO(by.read())])
|
||||
return result[0]
|
||||
Reference in New Issue
Block a user