From 9210a649f9aae29512a41129b42daed5d1cb7d16 Mon Sep 17 00:00:00 2001 From: shaohuzhang1 <80892890+shaohuzhang1@users.noreply.github.com> Date: Mon, 12 Aug 2024 16:02:13 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E4=BC=98=E5=8C=96Xorbits=20Inferen?= =?UTF-8?q?ce=E5=90=8D=E7=A7=B0=E6=98=BE=E7=A4=BA=20(#961)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: wxg0103 <727495428@qq.com> --- .../xinference_model_provider.py | 2 +- .../impl/zhipu_model_provider/model/llm.py | 11 ++--------- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/apps/setting/models_provider/impl/xinference_model_provider/xinference_model_provider.py b/apps/setting/models_provider/impl/xinference_model_provider/xinference_model_provider.py index 22b1068c3..d751fa7aa 100644 --- a/apps/setting/models_provider/impl/xinference_model_provider/xinference_model_provider.py +++ b/apps/setting/models_provider/impl/xinference_model_provider/xinference_model_provider.py @@ -508,7 +508,7 @@ class XinferenceModelProvider(IModelProvider): return model_info_manage def get_model_provide_info(self): - return ModelProvideInfo(provider='model_xinference_provider', name='Xinference', icon=get_file_content( + return ModelProvideInfo(provider='model_xinference_provider', name='Xorbits Inference', icon=get_file_content( os.path.join(PROJECT_DIR, "apps", "setting", 'models_provider', 'impl', 'xinference_model_provider', 'icon', 'xinference_icon_svg'))) diff --git a/apps/setting/models_provider/impl/zhipu_model_provider/model/llm.py b/apps/setting/models_provider/impl/zhipu_model_provider/model/llm.py index 0de026532..f12425ff4 100644 --- a/apps/setting/models_provider/impl/zhipu_model_provider/model/llm.py +++ b/apps/setting/models_provider/impl/zhipu_model_provider/model/llm.py @@ -6,21 +6,14 @@ @date:2024/4/28 11:42 @desc: """ -from typing import List, Dict from langchain_community.chat_models import ChatZhipuAI from langchain_community.chat_models.zhipuai import _truncate_params, _get_jwt_token, connect_sse, \ _convert_delta_to_message_chunk -from langchain_core.messages import BaseMessage, get_buffer_string - -from common.config.tokenizer_manage_config import TokenizerManage from setting.models_provider.base_model_provider import MaxKBBaseModel import json -import logging -import time -from collections.abc import AsyncIterator, Iterator -from contextlib import asynccontextmanager, contextmanager -from typing import Any, Dict, List, Optional, Tuple, Type, Union +from collections.abc import Iterator +from typing import Any, Dict, List, Optional from langchain_core.callbacks import ( CallbackManagerForLLMRun,