From 9dd2d9bbf1f5f689b036a4d7ae6ef847c31c81a4 Mon Sep 17 00:00:00 2001 From: glide-the <2533736852@qq.com> Date: Tue, 16 Apr 2024 15:04:27 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=97=A5=E5=BF=97=E4=BF=A1?= =?UTF-8?q?=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../model_providers/bootstrap_web/openai_bootstrap_web.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/model-providers/model_providers/bootstrap_web/openai_bootstrap_web.py b/model-providers/model_providers/bootstrap_web/openai_bootstrap_web.py index fe11a19c..a0661ec6 100644 --- a/model-providers/model_providers/bootstrap_web/openai_bootstrap_web.py +++ b/model-providers/model_providers/bootstrap_web/openai_bootstrap_web.py @@ -237,8 +237,10 @@ class RESTFulOpenAIBootstrapBaseWeb(OpenAIBootstrapBaseWeb): return await openai_embedding_text(response) except ValueError as e: + logger.error(f"Error while creating embeddings: {str(e)}") raise HTTPException(status_code=status.HTTP_400_BAD_REQUEST, detail=str(e)) except InvokeError as e: + logger.error(f"Error while creating embeddings: {str(e)}") raise HTTPException( status_code=status.HTTP_500_INTERNAL_SERVER_ERROR, detail=str(e) ) @@ -295,9 +297,11 @@ class RESTFulOpenAIBootstrapBaseWeb(OpenAIBootstrapBaseWeb): else: return await openai_chat_completion(response) except ValueError as e: + logger.error(f"Error while creating chat completion: {str(e)}") raise HTTPException(status_code=status.HTTP_400_BAD_REQUEST, detail=str(e)) except InvokeError as e: + logger.error(f"Error while creating chat completion: {str(e)}") raise HTTPException( status_code=status.HTTP_500_INTERNAL_SERVER_ERROR, detail=str(e) )