From 4029d35cf843a508db389af35296917f32c80b2d Mon Sep 17 00:00:00 2001 From: yumoqing Date: Fri, 6 Sep 2024 18:16:24 +0800 Subject: [PATCH] bugfix --- rtcllm/rtc.py | 5 ++--- rtcllm/stt.py | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/rtcllm/rtc.py b/rtcllm/rtc.py index e100aff..1333f8f 100644 --- a/rtcllm/rtc.py +++ b/rtcllm/rtc.py @@ -2,8 +2,6 @@ import asyncio import random import json -from faster_whisper import WhisperModel - from functools import partial from appPublic.dictObject import DictObject @@ -13,7 +11,8 @@ from aiortc.sdp import candidate_from_sdp, candidate_to_sdp from aiortc.contrib.media import MediaBlackhole, MediaPlayer, MediaRecorder, MediaRelay # from websockets.asyncio.client import connect -from websockets.asyncio.client import connect +# from websockets.asyncio.client import connect +from websockets.client import connect import websockets from stt import asr from vad import AudioTrackVad diff --git a/rtcllm/stt.py b/rtcllm/stt.py index 67e3fdd..7d86ec8 100644 --- a/rtcllm/stt.py +++ b/rtcllm/stt.py @@ -39,13 +39,13 @@ async def asr(a_file): r = None with open(a_file, 'rb') as f: oc = OAuthClient(DictObject(**opts)) - r = await oc('https://open-computing.cn', 'asr', {'audio_file':f}) + r = await oc('https://sage.open-computing.cn', 'asr', {'audio_file':f}) print(f'{r=}') return r with open(a_file, 'rb') as f: async with aiohttp.ClientSession() as session: - async with session.post("https://open-computing.cn/asr/generate", data={ + async with session.post("https://sage.open-computing.cn/asr/generate", data={ "model":"whisper", "audio_file":f }) as response: