Compare commits
2 Commits
066d108e94
...
4b6de15a04
Author | SHA1 | Date | |
---|---|---|---|
|
4b6de15a04 | ||
|
f09c6f82e9 |
@ -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
|
||||
|
@ -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)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user