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