update reqs and server/utils

This commit is contained in:
imClumsyPanda 2023-11-30 22:23:15 +08:00
parent 7e99cc12b3
commit 072e0a2a32
4 changed files with 6 additions and 5 deletions

View File

@ -15,7 +15,7 @@ nltk>=3.8.1
uvicorn~=0.23.1
starlette~=0.27.0
pydantic<2
unstructured[all-docs]>=0.11.0
unstructured[all-docs]==0.11.0
python-magic-bin; sys_platform == 'win32'
SQLAlchemy==2.0.19
faiss-cpu

View File

@ -15,7 +15,7 @@ nltk>=3.8.1
uvicorn~=0.23.1
starlette~=0.27.0
pydantic<2
unstructured[all-docs]>=0.11.0
unstructured[all-docs]==0.11.0
python-magic-bin; sys_platform == 'win32'
SQLAlchemy==2.0.19
faiss-cpu

View File

@ -12,7 +12,7 @@ nltk~=3.8.1
uvicorn~=0.23.1
starlette~=0.27.0
pydantic~=1.10.11
unstructured[docx,csv]>=0.10.4 # add pdf if need
unstructured[docx,csv]==0.11.0 # add pdf if need
python-magic-bin; sys_platform == 'win32'
SQLAlchemy==2.0.19
faiss-cpu

View File

@ -41,7 +41,7 @@ def get_ChatOpenAI(
**kwargs: Any,
) -> ChatOpenAI:
config = get_model_worker_config(model_name)
if config.get("openai-api"):
if model_name == "openai-api":
model_name = config.get("model_name")
model = ChatOpenAI(
streaming=streaming,
@ -56,6 +56,7 @@ def get_ChatOpenAI(
**kwargs
)
return model
def get_OpenAI(
model_name: str,
temperature: float,
@ -67,7 +68,7 @@ def get_OpenAI(
**kwargs: Any,
) -> OpenAI:
config = get_model_worker_config(model_name)
if config.get("openai-api"):
if model_name == "openai-api":
model_name = config.get("model_name")
model = OpenAI(
streaming=streaming,