This commit is contained in:
yumoqing 2024-08-03 18:22:53 +08:00
parent f8dc17f12f
commit 8603274074
2 changed files with 4 additions and 1 deletions

View File

@ -1,3 +1,4 @@
from appPublic.log import info, debug, warning, error, exception, critical
from ahserver.serverenv import ServerEnv
from aiohttp.web import StreamResponse
@ -12,6 +13,7 @@ async def generate(request, **kw):
line = await request.content.readline()
content = ''
while line:
info(f'read from request stream {line=}')
txt = await engine.stt(line)
content += txt
d = json.dumps({'content':content})
@ -19,6 +21,7 @@ async def generate(request, **kw):
await resp.write(btxt)
await resp.drain()
line = await request.content.readline()
info('response finish')
return resp
rf = RegisterFunction()

View File

@ -1,6 +1,6 @@
{
"logger":{
"name":"sage",
"name":"asr",
"levelname":"info",
"logfile":"$[workdir]$/logs/sage.log"
},