Compare commits

...

2 Commits

Author SHA1 Message Date
yumoqing
4b6de15a04 bugfix 2024-08-03 19:06:37 +08:00
yumoqing
f09c6f82e9 bugfix 2024-08-03 19:04:42 +08:00
2 changed files with 7 additions and 3 deletions

View File

@ -3,9 +3,11 @@ import argparse
from appPublic.log import MyLogger, info, debug, warning
from appPublic.folderUtils import ProgramPath
from appPublic.jsonConfig import getConfig
from appPublic.registerfunction import RegisterFunction
from ahserver.configuredServer import ConfiguredServer
from ahserver.serverenv import ServerEnv
from whisper_model import WhisperBase64
from asr_engine import generate
__version__ = '0.0.1'
@ -28,6 +30,8 @@ if __name__ == '__main__':
info(f'========sage version={__version__}========')
# server = ConfiguredServer(auth_klass=MyAuthAPI, workdir=workdir)
server = ConfiguredServer(workdir=workdir)
rf = RegisterFunction()
rf.register('generate', generate)
g = ServerEnv()
g.whisper_model = WhisperBase64()
port = args.port or config.website.port or 8080

View File

@ -1,9 +1,11 @@
from appPublic.log import info, debug, warning, error, exception, critical
from appPublic.dictObject import DictObject
from ahserver.serverenv import ServerEnv
from aiohttp.web import StreamResponse
async def generate(request, **kw):
model = kw.get('model', 'whisper')
params_kw = kw.get(params_kw, DictObject())
model = params_kw.model
engine = None
g = ServerEnv()
if model=='whisper':
@ -24,6 +26,4 @@ async def generate(request, **kw):
info('response finish')
return resp
rf = RegisterFunction()
rf.register('generate', generate)