neetnestor commited on
Commit
847e2f0
1 Parent(s): a297744

feat: switch to qwen-2.5 models

Browse files
Files changed (6) hide show
  1. README.md +2 -2
  2. dist/index.js +0 -0
  3. index.html +16 -5
  4. package.json +1 -1
  5. src/index.js +2 -1
  6. yarn.lock +4 -4
README.md CHANGED
@@ -1,5 +1,5 @@
1
  ---
2
- title: Webllm Phi 3.5 Chat
3
  emoji: 💬
4
  colorFrom: gray
5
  colorTo: indigo
@@ -8,4 +8,4 @@ pinned: false
8
  license: apache-2.0
9
  ---
10
 
11
- A space to chat with Phi 3.5 running locally in your browser, powered by [WebLLM](https://github.com/mlc-ai/web-llm/).
 
1
  ---
2
+ title: Webllm Qwen 2.5 Chat
3
  emoji: 💬
4
  colorFrom: gray
5
  colorTo: indigo
 
8
  license: apache-2.0
9
  ---
10
 
11
+ A space to chat with Qwen 2.5 running locally in your browser, powered by [WebLLM](https://github.com/mlc-ai/web-llm/).
dist/index.js CHANGED
The diff for this file is too large to render. See raw diff
 
index.html CHANGED
@@ -3,7 +3,7 @@
3
  <head>
4
  <meta charset="utf-8" />
5
  <meta name="viewport" content="width=device-width" />
6
- <title>WebLLM Phi 3.5 Chat</title>
7
  <link rel="stylesheet" href="styles/katex.min.css" />
8
  <link
9
  rel="stylesheet"
@@ -14,21 +14,32 @@
14
 
15
  <body>
16
  <main>
17
- <h1>WebLLM Phi 3.5 Chat</h1>
18
  <p>
19
- This space enables AI chat with Phi 3.5 models directly in your local
20
  browser, empowered by WebLLM.
21
  </p>
22
 
23
  <h2>Step 1: Configure And Download Model</h2>
24
  <div class="card vertical">
25
  <form class="configure-form">
 
 
 
 
 
 
 
 
 
 
 
26
  <!-- Quantization -->
27
  <div class="form-group">
28
  <label for="quantization">Quantization:</label>
29
  <select id="quantization" name="quantization">
30
- <option value="q4f16">q4f16</option>
31
- <option value="q4f32">q4f32</option>
32
  </select>
33
  </div>
34
 
 
3
  <head>
4
  <meta charset="utf-8" />
5
  <meta name="viewport" content="width=device-width" />
6
+ <title>WebLLM Qwen 2.5 Chat</title>
7
  <link rel="stylesheet" href="styles/katex.min.css" />
8
  <link
9
  rel="stylesheet"
 
14
 
15
  <body>
16
  <main>
17
+ <h1>WebLLM Qwen 2.5 Chat</h1>
18
  <p>
19
+ This space enables AI chat with Qwen 2.5 models directly in your local
20
  browser, empowered by WebLLM.
21
  </p>
22
 
23
  <h2>Step 1: Configure And Download Model</h2>
24
  <div class="card vertical">
25
  <form class="configure-form">
26
+ <!-- Model Size -->
27
+ <div class="form-group">
28
+ <label for="model_size">Model Size:</label>
29
+ <select id="model_size" name="model_size">
30
+ <option value="0.5B">0.5B</option>
31
+ <option value="1.5B">1.5B</option>
32
+ <option value="3B">3B</option>
33
+ <option value="7B">7B</option>
34
+ </select>
35
+ </div>
36
+
37
  <!-- Quantization -->
38
  <div class="form-group">
39
  <label for="quantization">Quantization:</label>
40
  <select id="quantization" name="quantization">
41
+ <option value="q4f16_1">q4f16</option>
42
+ <option value="q4f32_1">q4f32</option>
43
  </select>
44
  </div>
45
 
package.json CHANGED
@@ -8,7 +8,7 @@
8
  "dependencies": {
9
  "@babel/core": "^7.13.15",
10
  "@babel/preset-env": "^7.13.15",
11
- "@mlc-ai/web-llm": "^0.2.62",
12
  "katex": "^0.16.11",
13
  "rehype-highlight": "^7.0.0",
14
  "rehype-katex": "^7.0.0",
 
8
  "dependencies": {
9
  "@babel/core": "^7.13.15",
10
  "@babel/preset-env": "^7.13.15",
11
+ "@mlc-ai/web-llm": "^0.2.63",
12
  "katex": "^0.16.11",
13
  "rehype-highlight": "^7.0.0",
14
  "rehype-katex": "^7.0.0",
src/index.js CHANGED
@@ -44,6 +44,7 @@ engine.setLogLevel("INFO");
44
  engine.setInitProgressCallback(updateEngineInitProgressCallback);
45
 
46
  async function initializeWebLLMEngine() {
 
47
  const quantization = document.getElementById("quantization").value;
48
  const context_window_size = parseInt(document.getElementById("context").value);
49
  const temperature = parseFloat(document.getElementById("temperature").value);
@@ -52,7 +53,7 @@ async function initializeWebLLMEngine() {
52
  const frequency_penalty = parseFloat(document.getElementById("frequency_penalty").value);
53
 
54
  document.getElementById("download-status").classList.remove("hidden");
55
- const selectedModel = `Phi-3.5-mini-instruct-${quantization}_1-MLC`;
56
  const config = {
57
  temperature,
58
  top_p,
 
44
  engine.setInitProgressCallback(updateEngineInitProgressCallback);
45
 
46
  async function initializeWebLLMEngine() {
47
+ const model_size = document.getElementById("model_size").value;
48
  const quantization = document.getElementById("quantization").value;
49
  const context_window_size = parseInt(document.getElementById("context").value);
50
  const temperature = parseFloat(document.getElementById("temperature").value);
 
53
  const frequency_penalty = parseFloat(document.getElementById("frequency_penalty").value);
54
 
55
  document.getElementById("download-status").classList.remove("hidden");
56
+ const selectedModel = `Qwen2.5-${model_size}-Instruct-${quantization}-MLC`;
57
  const config = {
58
  temperature,
59
  top_p,
yarn.lock CHANGED
@@ -984,10 +984,10 @@
984
  "@jridgewell/resolve-uri" "^3.1.0"
985
  "@jridgewell/sourcemap-codec" "^1.4.14"
986
 
987
- "@mlc-ai/web-llm@^0.2.62":
988
- version "0.2.62"
989
- resolved "https://registry.npmjs.org/@mlc-ai/web-llm/-/web-llm-0.2.62.tgz"
990
- integrity sha512-biEYs13nfNjRa4GRVXRsnXLk/yCTslxSH3OjW/4PjoyvZcCtcIe4Aks20WnrMpJMz63ezE6noJF2fkFWStsI0A==
991
  dependencies:
992
  loglevel "^1.9.1"
993
 
 
984
  "@jridgewell/resolve-uri" "^3.1.0"
985
  "@jridgewell/sourcemap-codec" "^1.4.14"
986
 
987
+ "@mlc-ai/web-llm@^0.2.63":
988
+ version "0.2.63"
989
+ resolved "https://registry.yarnpkg.com/@mlc-ai/web-llm/-/web-llm-0.2.63.tgz#73d2871081fbcf088ce70ec29f08351b9889981e"
990
+ integrity sha512-X4xy3cS9Xh/UR//FU07eqcLdeGyMLTwLNF8pbIgJok8IJvzeigLqFXCGktGHf6HLlFRWE7A6+jVCjq1Iw4cGeA==
991
  dependencies:
992
  loglevel "^1.9.1"
993