From 072e0a2a32a806c90fd3225c3e873c945d3b6c2b Mon Sep 17 00:00:00 2001 From: imClumsyPanda Date: Thu, 30 Nov 2023 22:23:15 +0800 Subject: [PATCH] update reqs and server/utils --- requirements.txt | 2 +- requirements_api.txt | 2 +- requirements_lite.txt | 2 +- server/utils.py | 5 +++-- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/requirements.txt b/requirements.txt index 8dcf868..02ec030 100644 --- a/requirements.txt +++ b/requirements.txt @@ -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 diff --git a/requirements_api.txt b/requirements_api.txt index 9b31aad..53eda87 100644 --- a/requirements_api.txt +++ b/requirements_api.txt @@ -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 diff --git a/requirements_lite.txt b/requirements_lite.txt index e9d4493..3ef267f 100644 --- a/requirements_lite.txt +++ b/requirements_lite.txt @@ -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 diff --git a/server/utils.py b/server/utils.py index c12f044..1e0c424 100644 --- a/server/utils.py +++ b/server/utils.py @@ -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,