Skip to content

Commit

Permalink
merge from dev
Browse files Browse the repository at this point in the history
  • Loading branch information
liunux4odoo committed Dec 13, 2023
1 parent db008c1 commit c8fef33
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
1 change: 1 addition & 0 deletions requirements.txt
Expand Up @@ -12,6 +12,7 @@ torch==2.1.0 ##on Windows system, install the cuda version manually from https:
torchvision #on Windows system, install the cuda version manually from https://pytorch.org/
torchaudio #on Windows system, install the cuda version manually from https://pytorch.org/
fastapi>=0.104
sse_starlette
nltk>=3.8.1
uvicorn>=0.24.0.post1
starlette~=0.27.0
Expand Down
1 change: 1 addition & 0 deletions requirements_api.txt
Expand Up @@ -12,6 +12,7 @@ torch==2.1.0 ##on Windows system, install the cuda version manually from https:
torchvision #on Windows system, install the cuda version manually from https://pytorch.org/
torchaudio #on Windows system, install the cuda version manually from https://pytorch.org/
fastapi>=0.104
sse_starlette
nltk>=3.8.1
uvicorn>=0.24.0.post1
starlette~=0.27.0
Expand Down
9 changes: 2 additions & 7 deletions server/chat/knowledge_base_chat.py
@@ -1,5 +1,5 @@
from fastapi import Body, Request
from fastapi.responses import StreamingResponse
from sse_starlette.sse import EventSourceResponse
from fastapi.concurrency import run_in_threadpool
from configs import (LLM_MODELS, VECTOR_SEARCH_TOP_K, SCORE_THRESHOLD, TEMPERATURE)
from server.utils import wrap_done, get_ChatOpenAI
Expand Down Expand Up @@ -119,9 +119,4 @@ async def knowledge_base_chat_iterator(
ensure_ascii=False)
await task

return StreamingResponse(knowledge_base_chat_iterator(query=query,
top_k=top_k,
history=history,
model_name=model_name,
prompt_name=prompt_name),
media_type="text/event-stream")
return EventSourceResponse(knowledge_base_chat_iterator(query, kb, top_k, history))

0 comments on commit c8fef33

Please sign in to comment.