Skip to content

Commit

Permalink
model: add Qwen-2 Math models
Browse files Browse the repository at this point in the history
  • Loading branch information
Neet-Nestor committed Aug 8, 2024
1 parent 35bc80c commit 25fd9ec
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 20 deletions.
67 changes: 65 additions & 2 deletions app/constant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,6 @@ export const DEFAULT_MODELS: ModelRecord[] = [
provider: "Alibaba",
size: "7B",
quantization: "q4f16_1",

family: "Qwen 2",
vram_required_MB: 5106.67,
low_resource_required: false,
Expand All @@ -614,7 +613,71 @@ export const DEFAULT_MODELS: ModelRecord[] = [
provider: "Alibaba",
size: "7B",
quantization: "q4f32",

family: "Qwen 2",
vram_required_MB: 5900.09,
low_resource_required: false,
recommended_config: {
temperature: 0.7,
presence_penalty: 0,
frequency_penalty: 0,
top_p: 0.8,
},
},
// Qwen2-Math
{
name: "Qwen2-Math-1.5B-Instruct-q4f16_1-MLC",
display_name: "Qwen",
provider: "Alibaba",
size: "1.5B",
quantization: "q4f16_1",
family: "Qwen 2",
vram_required_MB: 1629.75,
low_resource_required: true,
recommended_config: {
temperature: 1.0,
presence_penalty: 0,
frequency_penalty: 0,
top_p: 0.8,
},
},
{
name: "Qwen2-Math-1.5B-Instruct-q4f32_1-MLC",
display_name: "Qwen",
provider: "Alibaba",
size: "1.5B",
quantization: "q4f32_1",
family: "Qwen 2",
vram_required_MB: 1888.97,
low_resource_required: true,
recommended_config: {
temperature: 1.0,
presence_penalty: 0,
frequency_penalty: 0,
top_p: 0.8,
},
},
{
name: "Qwen2-Math-7B-Instruct-q4f16_1-MLC",
display_name: "Qwen",
provider: "Alibaba",
size: "7B",
quantization: "q4f16_1",
family: "Qwen 2",
vram_required_MB: 5106.67,
low_resource_required: false,
recommended_config: {
temperature: 0.7,
presence_penalty: 0,
frequency_penalty: 0,
top_p: 0.8,
},
},
{
name: "Qwen2-Math-7B-Instruct-q4f32_1-MLC",
display_name: "Qwen",
provider: "Alibaba",
size: "7B",
quantization: "q4f32_1",
family: "Qwen 2",
vram_required_MB: 5900.09,
low_resource_required: false,
Expand Down
15 changes: 2 additions & 13 deletions app/store/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,25 +208,14 @@ export const useAppConfig = createPersistStore(
}),
{
name: StoreKey.Config,
version: 0.48,
version: 0.49,
migrate: (persistedState, version) => {
if (version < 0.48) {
if (version < 0.49) {
return {
...DEFAULT_CONFIG,
...(persistedState as any),
models: DEFAULT_MODELS as any as ModelRecord[],

sendMemory: (persistedState as any).modelConfig?.sendMemory || true,
historyMessageCount:
(persistedState as any).modelConfig?.historyMessageCount || 4,
compressMessageLengthThreshold:
(persistedState as any).modelConfig
?.compressMessageLengthThreshold || 1000,
enableInjectSystemPrompts:
(persistedState as any).modelConfig?.enableInjectSystemPrompts ||
false,
template: DEFAULT_INPUT_TEMPLATE,

modelConfig: {
model: DEFAULT_MODELS[0].name,

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"dependencies": {
"@fortaine/fetch-event-source": "^3.0.6",
"@hello-pangea/dnd": "^16.5.0",
"@mlc-ai/web-llm": "^0.2.52",
"@mlc-ai/web-llm": "^0.2.55",
"@serwist/next": "^9.0.2",
"@svgr/webpack": "^6.5.1",
"emoji-picker-react": "^4.9.2",
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1180,10 +1180,10 @@
"@jridgewell/resolve-uri" "^3.1.0"
"@jridgewell/sourcemap-codec" "^1.4.14"

"@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==
"@mlc-ai/web-llm@^0.2.55":
version "0.2.55"
resolved "https://registry.yarnpkg.com/@mlc-ai/web-llm/-/web-llm-0.2.55.tgz#678c1703df1a9c9d504fc81db6d2f7b7c5d39d7b"
integrity sha512-o2Nzmx//sT3ttWrnSYy6s7NTCnBEWPI8ubbzg6WH59dAI34pHSP/+V8UxtDS+ZlEXl0PV0iDgl1i+Y1WeKABlw==
dependencies:
loglevel "^1.9.1"

Expand Down

0 comments on commit 25fd9ec

Please sign in to comment.