mirror of
https://github.com/BoardWare-Genius/jarvis-models.git
synced 2025-12-13 16:53:24 +00:00
19 lines
495 B
Python
19 lines
495 B
Python
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]
|