This commit is contained in:
yumoqing 2024-08-03 19:04:42 +08:00
parent 066d108e94
commit f09c6f82e9
2 changed files with 4 additions and 2 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

@ -24,6 +24,4 @@ async def generate(request, **kw):
info('response finish')
return resp
rf = RegisterFunction()
rf.register('generate', generate)