This commit is contained in:
yumoqing 2024-09-10 10:42:06 +08:00
parent a4dc6ef93c
commit 183c50fd51
2 changed files with 1 additions and 4 deletions

View File

@ -6,8 +6,6 @@ from aiortc import VideoStreamTrack, AudioStreamTrack
class LLMAudioStreamTrack(AudioStreamTrack):
def __init__(self, omni_infer):
super().__init__()
self.ckpt_dir = ckpt_dir
# self.oi = OmniInference(ckpt_dir=ckpt_dir)
self.oi = omni_infer
self.audio_iters = []
self.cur_iters = None

View File

@ -50,7 +50,6 @@ class RTCLLM:
def __init__(self, ws_url, iceServers):
# self.stt_model = WhisperModel('large-v3', device="cuda", compute_type="float16")
self.ws_url = ws_url
self.omni_infer =
self.omni_infer = OmniInference(ckpt_dir='/d/models/mini-omni')
self.iceServers = iceServers
self.peers = DictObject()
@ -116,7 +115,7 @@ class RTCLLM:
async def auto_accept_call(self, data):
opts = DictObject(iceServers=self.iceServers)
pc = RTCPeerConnection(opts)
llmtrack = LLMAudioStreamTrack('/d/models/mini-omni')
llmtrack = LLMAudioStreamTrack(self.omni_infer)
feed = awaitify(self.llmtrack._feed)
self.peers[data['from'].id] = DictObject(**{
'info':data['from'],