浏览代码

Adding the Minimax model (#1009)

### What problem does this PR solve?

Added support for MiniMax LLM

### Type of change

- [x] New Feature (non-breaking change which adds functionality)

---------

Co-authored-by: cecilia-uu <konghui1996@163.com>
tags/v0.8.0
cecilia-uu 1年前
父节点
当前提交
260c68f60c
没有帐户链接到提交者的电子邮件
共有 3 个文件被更改,包括 58 次插入1 次删除
  1. 48
    0
      api/db/init_data.py
  2. 2
    1
      rag/llm/__init__.py
  3. 8
    0
      rag/llm/chat_model.py

+ 48
- 0
api/db/init_data.py 查看文件

@@ -152,6 +152,11 @@ factory_infos = [{
"logo": "",
"tags": "TEXT EMBEDDING, TEXT RE-RANK",
"status": "1",
},{
"name": "Minimax",
"logo": "",
"tags": "LLM,TEXT EMBEDDING",
"status": "1",
}
# {
# "name": "文心一言",
@@ -536,6 +541,49 @@ def init_llm_factory():
"max_tokens": 2048,
"model_type": LLMType.RERANK.value
},
# ------------------------ Minimax -----------------------
{
"fid": factory_infos[13]["name"],
"llm_name": "abab6.5-chat",
"tags": "LLM,CHAT,8k",
"max_tokens": 8192,
"model_type": LLMType.CHAT.value
},
{
"fid": factory_infos[13]["name"],
"llm_name": "abab6.5s-chat",
"tags": "LLM,CHAT,245k",
"max_tokens": 245760,
"model_type": LLMType.CHAT.value
},
{
"fid": factory_infos[13]["name"],
"llm_name": "abab6.5t-chat",
"tags": "LLM,CHAT,8k",
"max_tokens": 8192,
"model_type": LLMType.CHAT.value
},
{
"fid": factory_infos[13]["name"],
"llm_name": "abab6.5g-chat",
"tags": "LLM,CHAT,8k",
"max_tokens": 8192,
"model_type": LLMType.CHAT.value
},
{
"fid": factory_infos[13]["name"],
"llm_name": "abab5.5-chat",
"tags": "LLM,CHAT,16k",
"max_tokens": 16384,
"model_type": LLMType.CHAT.value
},
{
"fid": factory_infos[13]["name"],
"llm_name": "abab5.5s-chat",
"tags": "LLM,CHAT,8k",
"max_tokens": 8192,
"model_type": LLMType.CHAT.value
},
]
for info in factory_infos:
try:

+ 2
- 1
rag/llm/__init__.py 查看文件

@@ -51,7 +51,8 @@ ChatModel = {
"Xinference": XinferenceChat,
"Moonshot": MoonshotChat,
"DeepSeek": DeepSeekChat,
"BaiChuan": BaiChuanChat
"BaiChuan": BaiChuanChat,
"MiniMax": MiniMaxChat
}



+ 8
- 0
rag/llm/chat_model.py 查看文件

@@ -464,3 +464,11 @@ class VolcEngineChat(Base):
except Exception as e:
yield ans + "\n**ERROR**: " + str(e)
yield tk_count


class MiniMaxChat(Base):
def __init__(self, key, model_name="abab6.5s-chat",
base_url="https://api.minimax.chat/v1/text/chatcompletion_v2"):
if not base_url:
base_url="https://api.minimax.chat/v1/text/chatcompletion_v2"
super().__init__(key, model_name, base_url)

正在加载...
取消
保存