bugfix
This commit is contained in:
parent
86f7ee384b
commit
f89bc2eaa5
@ -36,13 +36,14 @@ opts = {
|
|||||||
async def asr(a_file):
|
async def asr(a_file):
|
||||||
if not a_file:
|
if not a_file:
|
||||||
return
|
return
|
||||||
|
"""
|
||||||
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://sage.open-computing.cn/asr', 'asr', {'audio_file':f})
|
r = await oc('https://sage.open-computing.cn/asr', '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://sage.open-computing.cn/asr/api/generate.dspy", data={
|
async with session.post("https://sage.open-computing.cn/asr/api/generate.dspy", data={
|
||||||
|
Loading…
Reference in New Issue
Block a user