bugfix
This commit is contained in:
parent
77d4c4b2aa
commit
f5bc75f183
@ -1,4 +1,5 @@
|
||||
import os
|
||||
import time
|
||||
from traceback import print_exc
|
||||
import base64
|
||||
import wave
|
||||
@ -44,12 +45,17 @@ async def generate(request, kw):
|
||||
'message':f'model={model} is not defined'
|
||||
}
|
||||
try:
|
||||
txt = await engine.stt(fname)
|
||||
t1 = time.time()
|
||||
dic = await engine.stt(fname)
|
||||
t2 = time.time()
|
||||
os.remove(fname)
|
||||
info(f'{txt=}')
|
||||
return {
|
||||
"status":"ok",
|
||||
"content":txt
|
||||
"time_cost":t2-t1,
|
||||
"content":dic['text'],
|
||||
"segments":dic['segments'],
|
||||
"language":dic['language']
|
||||
}
|
||||
except Exception as e:
|
||||
exception(f'{e}')
|
||||
|
Loading…
Reference in New Issue
Block a user