From eca7b95b17583c61c43636bb3d13d6f415052371 Mon Sep 17 00:00:00 2001 From: Nestor Qin Date: Wed, 31 Jul 2024 20:45:37 -0400 Subject: [PATCH] model: add Gemma 2 models --- app/constant.ts | 53 +++++++++++++++++++++++++++++++++++++-------- app/store/config.ts | 4 ++-- package.json | 2 +- yarn.lock | 8 +++---- 4 files changed, 51 insertions(+), 16 deletions(-) diff --git a/app/constant.ts b/app/constant.ts index 24d92d9c..14e3b22b 100644 --- a/app/constant.ts +++ b/app/constant.ts @@ -626,13 +626,13 @@ export const DEFAULT_MODELS: ModelRecord[] = [ }, }, { - name: "gemma-2b-it-q4f16_1-MLC", + name: "gemma-2-2b-it-q4f16_1-MLC", display_name: "Gemma", provider: "Google", size: "2B", quantization: "q4f16_1", family: "Gemma", - vram_required_MB: 1476.52, + vram_required_MB: 1895.3, low_resource_required: false, buffer_size_required_bytes: 262144000, required_features: ["shader-f16"], @@ -644,14 +644,13 @@ export const DEFAULT_MODELS: ModelRecord[] = [ }, }, { - name: "gemma-2b-it-q4f32_1-MLC", + name: "gemma-2-2b-it-q4f32_1-MLC", display_name: "Gemma", provider: "Google", size: "2B", quantization: "q4f32", - family: "Gemma", - vram_required_MB: 1750.66, + vram_required_MB: 2508.75, low_resource_required: false, buffer_size_required_bytes: 262144000, recommended_config: { @@ -662,13 +661,13 @@ export const DEFAULT_MODELS: ModelRecord[] = [ }, }, { - name: "gemma-2b-it-q4f16_1-MLC-1k", + name: "gemma-2-2b-it-q4f16_1-MLC-1k", display_name: "Gemma", provider: "Google", size: "2B", quantization: "q4f16_1", family: "Gemma", - vram_required_MB: 1476.52, + vram_required_MB: 1583.3, low_resource_required: true, buffer_size_required_bytes: 262144000, required_features: ["shader-f16"], @@ -680,13 +679,13 @@ export const DEFAULT_MODELS: ModelRecord[] = [ }, }, { - name: "gemma-2b-it-q4f32_1-MLC-1k", + name: "gemma-2-2b-it-q4f32_1-MLC-1k", display_name: "Gemma", provider: "Google", size: "2B", quantization: "q4f32", family: "Gemma", - vram_required_MB: 1750.66, + vram_required_MB: 1884.75, low_resource_required: true, buffer_size_required_bytes: 262144000, recommended_config: { @@ -696,6 +695,42 @@ export const DEFAULT_MODELS: ModelRecord[] = [ top_p: 0.95, }, }, + { + name: "gemma-2-9b-it-q4f16_1-MLC", + display_name: "Gemma", + provider: "Google", + size: "9B", + quantization: "q4f16", + family: "Gemma", + vram_required_MB: 6422.01, + low_resource_required: false, + buffer_size_required_bytes: 262144000, + required_features: ["shader-f16"], + recommended_config: { + temperature: 0.7, + presence_penalty: 0, + frequency_penalty: 1, + top_p: 0.95, + }, + }, + { + name: "gemma-2-9b-it-q4f32_1-MLC", + display_name: "Gemma", + provider: "Google", + size: "9B", + quantization: "q4f32", + family: "Gemma", + vram_required_MB: 8383.33, + low_resource_required: false, + buffer_size_required_bytes: 262144000, + required_features: ["shader-f16"], + recommended_config: { + temperature: 0.7, + presence_penalty: 0, + frequency_penalty: 1, + top_p: 0.95, + }, + }, { name: "stablelm-2-zephyr-1_6b-q4f16_1-MLC", display_name: "StableLM", diff --git a/app/store/config.ts b/app/store/config.ts index 2335a3b2..19492354 100644 --- a/app/store/config.ts +++ b/app/store/config.ts @@ -208,9 +208,9 @@ export const useAppConfig = createPersistStore( }), { name: StoreKey.Config, - version: 0.47, + version: 0.48, migrate: (persistedState, version) => { - if (version < 0.47) { + if (version < 0.48) { return { ...DEFAULT_CONFIG, ...(persistedState as any), diff --git a/package.json b/package.json index 7d8b252d..8a49ac15 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "dependencies": { "@fortaine/fetch-event-source": "^3.0.6", "@hello-pangea/dnd": "^16.5.0", - "@mlc-ai/web-llm": "^0.2.51", + "@mlc-ai/web-llm": "^0.2.52", "@serwist/next": "^9.0.2", "@svgr/webpack": "^6.5.1", "emoji-picker-react": "^4.9.2", diff --git a/yarn.lock b/yarn.lock index 70e2aa1e..b229d8df 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1180,10 +1180,10 @@ "@jridgewell/resolve-uri" "^3.1.0" "@jridgewell/sourcemap-codec" "^1.4.14" -"@mlc-ai/web-llm@^0.2.51": - version "0.2.51" - resolved "https://registry.yarnpkg.com/@mlc-ai/web-llm/-/web-llm-0.2.51.tgz#73dced138262bf79a1bc082dd36dc6d1a928b54f" - integrity sha512-62aiDyiSzUah1vqnTcZvH3lFRjz4VM2CeIBp7QpcFgX2HPA3vVYhDbV0cOVGAfK1MfH1CipZiyjOjkQUGjjRTw== +"@mlc-ai/web-llm@^0.2.52": + version "0.2.52" + resolved "https://registry.yarnpkg.com/@mlc-ai/web-llm/-/web-llm-0.2.52.tgz#15c0496b3ce8c35bd0ac5d1dd92d30cdc6c055db" + integrity sha512-TRjAQsOCUf7vrwVeOZoBZtB9KnW9InWK2w85rJWL7IBSSW/znYsNdD3/opmEGtf7NTKr4RBIu+8RdnhcZoHk4A== dependencies: loglevel "^1.9.1"