From 85744b72e5ba0c3041641eb5c159ad77abcf88c9 Mon Sep 17 00:00:00 2001 From: sino Date: Sun, 7 Jul 2024 01:17:33 +0800 Subject: [PATCH] feat: support moonshot and glm base models for volcengine provider (#6029) --- .../volcengine_maas/llm/models.py | 66 +++++++++++++++++++ .../volcengine_maas/volcengine_maas.yaml | 46 ++++++++++--- 2 files changed, 104 insertions(+), 8 deletions(-) diff --git a/api/core/model_runtime/model_providers/volcengine_maas/llm/models.py b/api/core/model_runtime/model_providers/volcengine_maas/llm/models.py index 3a793cd6a8..3e5938f3b4 100644 --- a/api/core/model_runtime/model_providers/volcengine_maas/llm/models.py +++ b/api/core/model_runtime/model_providers/volcengine_maas/llm/models.py @@ -111,5 +111,71 @@ ModelConfigs = { 'mode': 'chat', }, 'features': [], + }, + 'Moonshot-v1-8k': { + 'req_params': { + 'max_prompt_tokens': 8192, + 'max_new_tokens': 4096, + }, + 'model_properties': { + 'context_size': 8192, + 'mode': 'chat', + }, + 'features': [], + }, + 'Moonshot-v1-32k': { + 'req_params': { + 'max_prompt_tokens': 32768, + 'max_new_tokens': 16384, + }, + 'model_properties': { + 'context_size': 32768, + 'mode': 'chat', + }, + 'features': [], + }, + 'Moonshot-v1-128k': { + 'req_params': { + 'max_prompt_tokens': 131072, + 'max_new_tokens': 65536, + }, + 'model_properties': { + 'context_size': 131072, + 'mode': 'chat', + }, + 'features': [], + }, + 'GLM3-130B': { + 'req_params': { + 'max_prompt_tokens': 8192, + 'max_new_tokens': 4096, + }, + 'model_properties': { + 'context_size': 8192, + 'mode': 'chat', + }, + 'features': [], + }, + 'GLM3-130B-Fin': { + 'req_params': { + 'max_prompt_tokens': 8192, + 'max_new_tokens': 4096, + }, + 'model_properties': { + 'context_size': 8192, + 'mode': 'chat', + }, + 'features': [], + }, + 'Mistral-7B': { + 'req_params': { + 'max_prompt_tokens': 8192, + 'max_new_tokens': 2048, + }, + 'model_properties': { + 'context_size': 8192, + 'mode': 'chat', + }, + 'features': [], } } diff --git a/api/core/model_runtime/model_providers/volcengine_maas/volcengine_maas.yaml b/api/core/model_runtime/model_providers/volcengine_maas/volcengine_maas.yaml index 4d468969b7..a00c1b7994 100644 --- a/api/core/model_runtime/model_providers/volcengine_maas/volcengine_maas.yaml +++ b/api/core/model_runtime/model_providers/volcengine_maas/volcengine_maas.yaml @@ -120,12 +120,6 @@ model_credential_schema: show_on: - variable: __model_type value: llm - - label: - en_US: Skylark2-pro-4k - value: Skylark2-pro-4k - show_on: - - variable: __model_type - value: llm - label: en_US: Llama3-8B value: Llama3-8B @@ -138,6 +132,42 @@ model_credential_schema: show_on: - variable: __model_type value: llm + - label: + en_US: Moonshot-v1-8k + value: Moonshot-v1-8k + show_on: + - variable: __model_type + value: llm + - label: + en_US: Moonshot-v1-32k + value: Moonshot-v1-32k + show_on: + - variable: __model_type + value: llm + - label: + en_US: Moonshot-v1-128k + value: Moonshot-v1-128k + show_on: + - variable: __model_type + value: llm + - label: + en_US: GLM3-130B + value: GLM3-130B + show_on: + - variable: __model_type + value: llm + - label: + en_US: GLM3-130B-Fin + value: GLM3-130B-Fin + show_on: + - variable: __model_type + value: llm + - label: + en_US: Mistral-7B + value: Mistral-7B + show_on: + - variable: __model_type + value: llm - label: en_US: Doubao-embedding value: Doubao-embedding @@ -181,7 +211,7 @@ model_credential_schema: zh_Hans: 模型上下文长度 en_US: Model Context Size type: text-input - default: '4096' + default: "4096" placeholder: zh_Hans: 输入您的模型上下文长度 en_US: Enter your Model Context Size @@ -195,7 +225,7 @@ model_credential_schema: label: zh_Hans: 最大 token 上限 en_US: Upper Bound for Max Tokens - default: '4096' + default: "4096" type: text-input placeholder: zh_Hans: 输入您的模型最大 token 上限