From c3ee8947e7710715863eb5836af8218b940f70d2 Mon Sep 17 00:00:00 2001 From: Taichiro Suzuki Date: Tue, 12 Nov 2024 11:31:35 +0900 Subject: [PATCH 1/2] fix --- docs/DEPLOY_OPTION.md | 2 -- packages/cdk/lambda/utils/models.ts | 16 ---------------- packages/cdk/lib/construct/api.ts | 2 -- 3 files changed, 20 deletions(-) diff --git a/docs/DEPLOY_OPTION.md b/docs/DEPLOY_OPTION.md index 0b7425a9..4024f312 100644 --- a/docs/DEPLOY_OPTION.md +++ b/docs/DEPLOY_OPTION.md @@ -453,8 +453,6 @@ PromptFlow チャットユースケースでは、作成済みの Prompt Flow "anthropic.claude-v2:1", "anthropic.claude-v2", "anthropic.claude-instant-v1", -"meta.llama2-70b-chat-v1", -"meta.llama2-13b-chat-v1", "mistral.mixtral-8x7b-instruct-v0:1", "mistral.mistral-7b-instruct-v0:2" ``` diff --git a/packages/cdk/lambda/utils/models.ts b/packages/cdk/lambda/utils/models.ts index 0ac1e327..23309d8f 100644 --- a/packages/cdk/lambda/utils/models.ts +++ b/packages/cdk/lambda/utils/models.ts @@ -828,22 +828,6 @@ export const BEDROCK_TEXT_GEN_MODELS: { extractConverseOutputText: extractConverseOutputText, extractConverseStreamOutputText: extractConverseStreamOutputText, }, - 'meta.llama2-13b-chat-v1': { - defaultParams: LLAMA_DEFAULT_PARAMS, - usecaseParams: USECASE_DEFAULT_PARAMS, - createConverseCommandInput: createConverseCommandInput, - createConverseStreamCommandInput: createConverseStreamCommandInput, - extractConverseOutputText: extractConverseOutputText, - extractConverseStreamOutputText: extractConverseStreamOutputText, - }, - 'meta.llama2-70b-chat-v1': { - defaultParams: LLAMA_DEFAULT_PARAMS, - usecaseParams: USECASE_DEFAULT_PARAMS, - createConverseCommandInput: createConverseCommandInput, - createConverseStreamCommandInput: createConverseStreamCommandInput, - extractConverseOutputText: extractConverseOutputText, - extractConverseStreamOutputText: extractConverseStreamOutputText, - }, 'mistral.mistral-7b-instruct-v0:2': { defaultParams: MISTRAL_DEFAULT_PARAMS, usecaseParams: USECASE_DEFAULT_PARAMS, diff --git a/packages/cdk/lib/construct/api.ts b/packages/cdk/lib/construct/api.ts index 61ca0976..dd5e9d7f 100644 --- a/packages/cdk/lib/construct/api.ts +++ b/packages/cdk/lib/construct/api.ts @@ -110,8 +110,6 @@ export class Api extends Construct { 'us.meta.llama3-2-3b-instruct-v1:0', 'us.meta.llama3-2-11b-instruct-v1:0', 'us.meta.llama3-2-90b-instruct-v1:0', - 'meta.llama2-13b-chat-v1', - 'meta.llama2-70b-chat-v1', 'mistral.mistral-7b-instruct-v0:2', 'mistral.mixtral-8x7b-instruct-v0:1', 'mistral.mistral-small-2402-v1:0', From fd6fdc957fd4bf9d689533af92842fed2879b1fa Mon Sep 17 00:00:00 2001 From: Taichiro Suzuki Date: Wed, 13 Nov 2024 11:07:03 +0900 Subject: [PATCH 2/2] fix --- packages/cdk/lambda/utils/models.ts | 6 +++--- packages/types/src/text.d.ts | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/cdk/lambda/utils/models.ts b/packages/cdk/lambda/utils/models.ts index 23309d8f..a14c3eb2 100644 --- a/packages/cdk/lambda/utils/models.ts +++ b/packages/cdk/lambda/utils/models.ts @@ -44,7 +44,7 @@ export const defaultImageGenerationModel: Model = { // Prompt Templates -const LLAMA2_PROMPT: PromptTemplate = { +const LLAMA_PROMPT: PromptTemplate = { prefix: '[INST] ', suffix: ' [/INST]', join: '', @@ -925,8 +925,8 @@ export const BEDROCK_IMAGE_GEN_MODELS: { }; export const getSageMakerModelTemplate = (model: string): PromptTemplate => { - if (model.includes('llama-2')) { - return LLAMA2_PROMPT; + if (model.includes('llama')) { + return LLAMA_PROMPT; } else if (model.includes('bilingual-rinna')) { return BILINGUAL_RINNA_PROMPT; } else if (model.includes('rinna')) { diff --git a/packages/types/src/text.d.ts b/packages/types/src/text.d.ts index d8a639c7..c55ce3f6 100644 --- a/packages/types/src/text.d.ts +++ b/packages/types/src/text.d.ts @@ -68,7 +68,7 @@ export type ClaudeMessageParams = { top_p?: number; }; -// Llama2 +// Llama // https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters-meta.html export type LlamaParams = { prompt?: string; @@ -166,7 +166,7 @@ export type BedrockResponse = { }; // Titan outputText: string; - // Llama2 + // Llama generation: string; // Mistral outputs: {