bugfix
This commit is contained in:
parent
0b484b0adf
commit
46d9621315
BIN
test/.t.py.swp
Normal file
BIN
test/.t.py.swp
Normal file
Binary file not shown.
29
test/t.py
Normal file
29
test/t.py
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
import sys
|
||||||
|
import os
|
||||||
|
import asyncio
|
||||||
|
from appPublic.jsonConfig import getConfig
|
||||||
|
from sqlor.dbpools import DBPools
|
||||||
|
from ahserver.serverenv import ServerEnv
|
||||||
|
from uapi.appapi import UAPI
|
||||||
|
|
||||||
|
def get_module_dbname(mn):
|
||||||
|
return 'sage'
|
||||||
|
|
||||||
|
async def main():
|
||||||
|
workdir = os.getcwd()
|
||||||
|
config = getConfig(workdir, {'workdir':workdir})
|
||||||
|
DBPools(config.databases)
|
||||||
|
env = ServerEnv()
|
||||||
|
env.get_module_dbname = get_module_dbname
|
||||||
|
uapi = UAPI()
|
||||||
|
params = {
|
||||||
|
'baseurl':'https://qianfan.baidubce.com',
|
||||||
|
'model':'ernie-3.5-8k',
|
||||||
|
'prompt':'who are you',
|
||||||
|
}
|
||||||
|
async for line in uapi('MRXYc49LwTjyTLuOVk89R', '0', params=params):
|
||||||
|
print(line)
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
asyncio.new_event_loop().run_until_complete(main())
|
||||||
|
|
Loading…
Reference in New Issue
Block a user