bugfix
This commit is contained in:
parent
fed1b506c6
commit
4029d35cf8
@ -2,8 +2,6 @@ import asyncio
|
|||||||
import random
|
import random
|
||||||
import json
|
import json
|
||||||
|
|
||||||
from faster_whisper import WhisperModel
|
|
||||||
|
|
||||||
from functools import partial
|
from functools import partial
|
||||||
|
|
||||||
from appPublic.dictObject import DictObject
|
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 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.asyncio.client import connect
|
||||||
|
from websockets.client import connect
|
||||||
import websockets
|
import websockets
|
||||||
from stt import asr
|
from stt import asr
|
||||||
from vad import AudioTrackVad
|
from vad import AudioTrackVad
|
||||||
|
@ -39,13 +39,13 @@ async def asr(a_file):
|
|||||||
r = None
|
r = None
|
||||||
with open(a_file, 'rb') as f:
|
with open(a_file, 'rb') as f:
|
||||||
oc = OAuthClient(DictObject(**opts))
|
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=}')
|
print(f'{r=}')
|
||||||
return r
|
return r
|
||||||
|
|
||||||
with open(a_file, 'rb') as f:
|
with open(a_file, 'rb') as f:
|
||||||
async with aiohttp.ClientSession() as session:
|
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",
|
"model":"whisper",
|
||||||
"audio_file":f
|
"audio_file":f
|
||||||
}) as response:
|
}) as response:
|
||||||
|
Loading…
Reference in New Issue
Block a user