From a126d535cf146ce5473974bfbe500d209a5b1693 Mon Sep 17 00:00:00 2001 From: AAEE86 <33052466+AAEE86@users.noreply.github.com> Date: Mon, 23 Sep 2024 16:39:46 +0800 Subject: [PATCH] add Spark Max-32K (#8676) --- .../model_providers/spark/llm/_client.py | 3 +- .../model_providers/spark/llm/_position.yaml | 1 + .../spark/llm/spark-max-32k.yaml | 33 +++++++++++++++++++ 3 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 api/core/model_runtime/model_providers/spark/llm/spark-max-32k.yaml diff --git a/api/core/model_runtime/model_providers/spark/llm/_client.py b/api/core/model_runtime/model_providers/spark/llm/_client.py index b99a657e71..48911f657a 100644 --- a/api/core/model_runtime/model_providers/spark/llm/_client.py +++ b/api/core/model_runtime/model_providers/spark/llm/_client.py @@ -25,6 +25,7 @@ class SparkLLMClient: "spark-pro": {"version": "v3.1", "chat_domain": "generalv3"}, "spark-pro-128k": {"version": "pro-128k", "chat_domain": "pro-128k"}, "spark-max": {"version": "v3.5", "chat_domain": "generalv3.5"}, + "spark-max-32k": {"version": "max-32k", "chat_domain": "max-32k"}, "spark-4.0-ultra": {"version": "v4.0", "chat_domain": "4.0Ultra"}, } @@ -32,7 +33,7 @@ class SparkLLMClient: self.chat_domain = model_api_configs[model]["chat_domain"] - if model == "spark-pro-128k": + if model in ["spark-pro-128k", "spark-max-32k"]: self.api_base = f"wss://{domain}/{endpoint}/{api_version}" else: self.api_base = f"wss://{domain}/{api_version}/{endpoint}" diff --git a/api/core/model_runtime/model_providers/spark/llm/_position.yaml b/api/core/model_runtime/model_providers/spark/llm/_position.yaml index 458397f2aa..73f39cb119 100644 --- a/api/core/model_runtime/model_providers/spark/llm/_position.yaml +++ b/api/core/model_runtime/model_providers/spark/llm/_position.yaml @@ -1,3 +1,4 @@ +- spark-max-32k - spark-4.0-ultra - spark-max - spark-pro-128k diff --git a/api/core/model_runtime/model_providers/spark/llm/spark-max-32k.yaml b/api/core/model_runtime/model_providers/spark/llm/spark-max-32k.yaml new file mode 100644 index 0000000000..1a1ab6844c --- /dev/null +++ b/api/core/model_runtime/model_providers/spark/llm/spark-max-32k.yaml @@ -0,0 +1,33 @@ +model: spark-max-32k +label: + en_US: Spark Max-32K +model_type: llm +model_properties: + mode: chat +parameter_rules: + - name: temperature + use_template: temperature + default: 0.5 + help: + zh_Hans: 核采样阈值。用于决定结果随机性,取值越高随机性越强即相同的问题得到的不同答案的可能性越高。 + en_US: Kernel sampling threshold. Used to determine the randomness of the results. The higher the value, the stronger the randomness, that is, the higher the possibility of getting different answers to the same question. + - name: max_tokens + use_template: max_tokens + default: 4096 + min: 1 + max: 8192 + help: + zh_Hans: 模型回答的tokens的最大长度。 + en_US: Maximum length of tokens for the model response. + - name: top_k + label: + zh_Hans: 取样数量 + en_US: Top k + type: int + default: 4 + min: 1 + max: 6 + help: + zh_Hans: 从 k 个候选中随机选择一个(非等概率)。 + en_US: Randomly select one from k candidates (non-equal probability). + required: false