bugfix
This commit is contained in:
parent
3cd51e3465
commit
ae6e0cfc41
@ -44,7 +44,7 @@ RTCPeerConnection.get_local_candidates = pc_get_local_candidates
|
||||
|
||||
class RTCLLM:
|
||||
def __init__(self, ws_url, iceServers):
|
||||
self.stt_model = WhisperModel('large-v3', device="cuda", compute_type="float16")
|
||||
# self.stt_model = WhisperModel('large-v3', device="cuda", compute_type="float16")
|
||||
self.ws_url = ws_url
|
||||
self.iceServers = iceServers
|
||||
self.peers = DictObject()
|
||||
@ -101,7 +101,7 @@ class RTCLLM:
|
||||
self.onlineList = data.onlineList
|
||||
|
||||
async def vad_voiceend(self, peer, audio):
|
||||
ret = await asr(self.stt_model, audio)
|
||||
ret = await asr(audio)
|
||||
# await peer.dc.send(txt)
|
||||
|
||||
|
||||
|
@ -30,11 +30,11 @@ opts = {
|
||||
"asr":desc
|
||||
}
|
||||
|
||||
async def asr(model, a_file):
|
||||
"""
|
||||
async def asr(a_file):
|
||||
oc = OAuthClient(DictObject(**opts))
|
||||
r = await oc("http://open-computing.cn", "asr", {"b64audio":audio})
|
||||
print(f'{r=}')
|
||||
with open(a_file, 'rb') as f:
|
||||
r = await oc("http://open-computing.cn", "asr", {"audio_file":f})
|
||||
print(f'{r=}')
|
||||
"""
|
||||
segments, info = model.transcribe(a_file, beam_size=5)
|
||||
txt = ''
|
||||
@ -44,3 +44,4 @@ async def asr(model, a_file):
|
||||
'content': txt,
|
||||
'language': info.language
|
||||
}
|
||||
"""
|
||||
|
Loading…
Reference in New Issue
Block a user