Spaces:
Running
Running
vlff李飞飞
commited on
Commit
•
2b17e2a
1
Parent(s):
b6a7ec0
更新oai
Browse files
qwen_server/database_server.py
CHANGED
@@ -79,6 +79,17 @@ async def healthz(request: Request):
|
|
79 |
return JSONResponse({"healthz": True})
|
80 |
|
81 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
82 |
@app.post('/endpoint')
|
83 |
async def web_listening(request: Request):
|
84 |
data = await request.json()
|
@@ -112,7 +123,6 @@ from qwen_server.assistant_server import demo as assistant_app
|
|
112 |
# app = gr.mount_gradio_app(app, workstation_app, path="/workstation")
|
113 |
app = gr.mount_gradio_app(app, assistant_app, path="/")
|
114 |
|
115 |
-
|
116 |
if __name__ == '__main__':
|
117 |
uvicorn.run(app='database_server:app',
|
118 |
host=server_config.server.server_host,
|
|
|
79 |
return JSONResponse({"healthz": True})
|
80 |
|
81 |
|
82 |
+
@app.get('/cachedata')
|
83 |
+
async def cache_data(request: Request):
|
84 |
+
data = await request.json()
|
85 |
+
file_name = data['file_name']
|
86 |
+
cache_file = os.path.join(server_config.path.cache_root, file_name)
|
87 |
+
lines = []
|
88 |
+
for line in jsonlines.open(cache_file):
|
89 |
+
lines.apend(line)
|
90 |
+
return JSONResponse(lines)
|
91 |
+
|
92 |
+
|
93 |
@app.post('/endpoint')
|
94 |
async def web_listening(request: Request):
|
95 |
data = await request.json()
|
|
|
123 |
# app = gr.mount_gradio_app(app, workstation_app, path="/workstation")
|
124 |
app = gr.mount_gradio_app(app, assistant_app, path="/")
|
125 |
|
|
|
126 |
if __name__ == '__main__':
|
127 |
uvicorn.run(app='database_server:app',
|
128 |
host=server_config.server.server_host,
|