handler request sync

This commit is contained in:
csunny 2023-04-30 21:27:55 +08:00
parent c5bce42856
commit 9e9a9b70ed
2 changed files with 5 additions and 6 deletions

View File

@ -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()

View File

@ -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