bugfix
This commit is contained in:
parent
4029d35cf8
commit
b6c93d375d
@ -3,7 +3,7 @@ from appPublic.dictObject import DictObject
|
|||||||
from appPublic.oauth_client import OAuthClient
|
from appPublic.oauth_client import OAuthClient
|
||||||
|
|
||||||
desc = {
|
desc = {
|
||||||
"path":"/asr/generate",
|
"path":"/api/generate",
|
||||||
"method":"POST",
|
"method":"POST",
|
||||||
"headers":[
|
"headers":[
|
||||||
{
|
{
|
||||||
@ -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://sage.open-computing.cn', '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/generate", data={
|
async with session.post("https://sage.open-computing.cn/asr/api/generate.dspy", data={
|
||||||
"model":"whisper",
|
"model":"whisper",
|
||||||
"audio_file":f
|
"audio_file":f
|
||||||
}) as response:
|
}) as response:
|
||||||
|
Loading…
Reference in New Issue
Block a user