feat: update aws bedrock (#3326)

Co-authored-by: chenhe <guchenhe@gmail.com>
This commit is contained in:
crazywoola 2024-04-11 15:38:55 +08:00 committed by GitHub
parent b98e363a5c
commit 7c520b52c1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 6 additions and 13 deletions

View File

@ -2,8 +2,6 @@ model: amazon.titan-text-express-v1
label: label:
en_US: Titan Text G1 - Express en_US: Titan Text G1 - Express
model_type: llm model_type: llm
features:
- agent-thought
model_properties: model_properties:
mode: chat mode: chat
context_size: 8192 context_size: 8192

View File

@ -2,8 +2,6 @@ model: amazon.titan-text-lite-v1
label: label:
en_US: Titan Text G1 - Lite en_US: Titan Text G1 - Lite
model_type: llm model_type: llm
features:
- agent-thought
model_properties: model_properties:
mode: chat mode: chat
context_size: 4096 context_size: 4096

View File

@ -50,3 +50,4 @@ pricing:
output: '0.024' output: '0.024'
unit: '0.001' unit: '0.001'
currency: USD currency: USD
deprecated: true

View File

@ -22,7 +22,7 @@ parameter_rules:
min: 0 min: 0
max: 500 max: 500
default: 0 default: 0
- name: max_tokens_to_sample - name: max_tokens
use_template: max_tokens use_template: max_tokens
required: true required: true
default: 4096 default: 4096

View File

@ -8,9 +8,9 @@ model_properties:
parameter_rules: parameter_rules:
- name: temperature - name: temperature
use_template: temperature use_template: temperature
- name: top_p - name: p
use_template: top_p use_template: top_p
- name: top_k - name: k
label: label:
zh_Hans: 取样数量 zh_Hans: 取样数量
en_US: Top k en_US: Top k
@ -19,7 +19,7 @@ parameter_rules:
zh_Hans: 仅从每个后续标记的前 K 个选项中采样。 zh_Hans: 仅从每个后续标记的前 K 个选项中采样。
en_US: Only sample from the top K options for each subsequent token. en_US: Only sample from the top K options for each subsequent token.
required: false required: false
- name: max_tokens_to_sample - name: max_tokens
use_template: max_tokens use_template: max_tokens
required: true required: true
default: 4096 default: 4096

View File

@ -503,7 +503,7 @@ class BedrockLargeLanguageModel(LargeLanguageModel):
if model_prefix == "amazon": if model_prefix == "amazon":
payload["textGenerationConfig"] = { **model_parameters } payload["textGenerationConfig"] = { **model_parameters }
payload["textGenerationConfig"]["stopSequences"] = ["User:"] + (stop if stop else []) payload["textGenerationConfig"]["stopSequences"] = ["User:"]
payload["inputText"] = self._convert_messages_to_prompt(prompt_messages, model_prefix) payload["inputText"] = self._convert_messages_to_prompt(prompt_messages, model_prefix)
@ -513,10 +513,6 @@ class BedrockLargeLanguageModel(LargeLanguageModel):
payload["maxTokens"] = model_parameters.get("maxTokens") payload["maxTokens"] = model_parameters.get("maxTokens")
payload["prompt"] = self._convert_messages_to_prompt(prompt_messages, model_prefix) payload["prompt"] = self._convert_messages_to_prompt(prompt_messages, model_prefix)
# jurassic models only support a single stop sequence
if stop:
payload["stopSequences"] = stop[0]
if model_parameters.get("presencePenalty"): if model_parameters.get("presencePenalty"):
payload["presencePenalty"] = {model_parameters.get("presencePenalty")} payload["presencePenalty"] = {model_parameters.get("presencePenalty")}
if model_parameters.get("frequencyPenalty"): if model_parameters.get("frequencyPenalty"):