From 9e9a9b70eda2d694dbfa125a473834c19a5ca0da Mon Sep 17 00:00:00 2001 From: csunny Date: Sun, 30 Apr 2023 21:27:55 +0800 Subject: [PATCH] handler request sync --- pilot/server/vicuna_server.py | 9 ++++----- pilot/server/webserver.py | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/pilot/server/vicuna_server.py b/pilot/server/vicuna_server.py index 568503d6c..00dc87057 100644 --- a/pilot/server/vicuna_server.py +++ b/pilot/server/vicuna_server.py @@ -64,14 +64,13 @@ def generate_stream_gate(params): @app.post("/generate_stream") -async def api_generate_stream(request: Request): +def api_generate_stream(request: Request): global model_semaphore, global_counter global_counter += 1 - params = await request.json() + params = request.json() print(model, tokenizer, params, DEVICE) - if model_semaphore is None: - model_semaphore = asyncio.Semaphore(LIMIT_MODEL_CONCURRENCY) - await model_semaphore.acquire() + # if model_semaphore is None: + # model_semaphore = asyncio.Semaphore(LIMIT_MODEL_CONCURRENCY) generator = generate_stream_gate(params) background_tasks = BackgroundTasks() diff --git a/pilot/server/webserver.py b/pilot/server/webserver.py index 7b37895a1..1a2ea0665 100644 --- a/pilot/server/webserver.py +++ b/pilot/server/webserver.py @@ -254,7 +254,7 @@ def build_single_model_ui(): notice_markdown = """ # DB-GPT - [DB-GPT](https://github.com/csunny/DB-GPT) 是一个实验性的开源应用程序,它基于[FastChat](https://github.com/lm-sys/FastChat),并使用vicuna作为基础模型。此外,此程序结合了langchain和llama-index基于现有知识库进行In-Context Learning来对其进行数据库相关知识的增强, 总的来说,它似乎是一个用于数据库的复杂且创新的AI工具。如果您对如何在工作中使用或实施 DB-GPT 有任何具体问题,请告诉我,我会尽力帮助您。 + [DB-GPT](https://github.com/csunny/DB-GPT) 是一个实验性的开源应用程序,它基于[FastChat](https://github.com/lm-sys/FastChat),并使用vicuna作为基础模型。此外,此程序结合了langchain和llama-index基于现有知识库进行In-Context Learning来对其进行数据库相关知识的增强, 总的来说,它是一个用于数据库的复杂且创新的AI工具。如果您对如何在工作中使用或实施DB-GPT有任何具体问题,请联系我, 我会尽力提供帮助, 同时也欢迎大家参与到项目建设中, 做一些有趣的事情。 """ learn_more_markdown = """ ### Licence