fhueni commited on
Commit
7f224da
·
1 Parent(s): 8b3b676

feat: added additional models

Browse files
Files changed (4) hide show
  1. index.html +8 -2
  2. src/main.js +1 -1
  3. src/services/onDeviceService.js +1 -1
  4. src/utils.js +1 -1
index.html CHANGED
@@ -18,6 +18,10 @@
18
  <select id="cloudModel"
19
  class="w-full mb-4 px-3 py-2 rounded-lg border border-gray-300 focus:ring-2 focus:ring-blue-500 focus:outline-none">
20
  <option value="openai/gpt-4o-mini">openai/gpt-4o-mini</option>
 
 
 
 
21
  </select>
22
  </label>
23
 
@@ -38,8 +42,10 @@
38
  <select id="deviceModel"
39
  class="w-full mb-2 px-3 py-2 rounded-lg border border-gray-300 focus:ring-2 focus:ring-blue-500 focus:outline-none">
40
  <option value="onnx-community/gemma-3-270m-it-ONNX">gemma-3-270m-it-ONNX</option>
41
- <option value="onnx-community/Llama-3.2-1B-Instruct">Llama-3.2-1B-Instruct</option>
42
- <option value="Xenova/distilgpt2">distilgpt2</option>
 
 
43
  </select>
44
  </label>
45
 
 
18
  <select id="cloudModel"
19
  class="w-full mb-4 px-3 py-2 rounded-lg border border-gray-300 focus:ring-2 focus:ring-blue-500 focus:outline-none">
20
  <option value="openai/gpt-4o-mini">openai/gpt-4o-mini</option>
21
+ <option value="meta-llama/llama-3.2-1b-instruct">meta-llama/llama-3.2-1b-instruct</option>
22
+ <option value="google/gemma-3n-e2b-it:free">google/gemma-3n-e2b-it:free</option>
23
+ <option value="meta-llama/llama-3.2-1b-instruct">meta-llama/llama-3.2-1b-instruct</option>
24
+ <option value="meta-llama/llama-3.2-3b-instruct">meta-llama/llama-3.2-3b-instruct</option>
25
  </select>
26
  </label>
27
 
 
42
  <select id="deviceModel"
43
  class="w-full mb-2 px-3 py-2 rounded-lg border border-gray-300 focus:ring-2 focus:ring-blue-500 focus:outline-none">
44
  <option value="onnx-community/gemma-3-270m-it-ONNX">gemma-3-270m-it-ONNX</option>
45
+ <option value="onnx-community/gemma-3-1b-it-ONNX">gemma-3-1b-it-ONNX</option>
46
+ <option value="onnx-community/Llama-3.2-1B-Instruct-ONNX">Llama-3.2-1B-Instruct-ONNX</option>
47
+ <option value="onnx-community/Llama-3.2-3B-Instruct-ONNX">Llama-3.2-3B-Instruct-ONNX</option>
48
+ <option disabled value="onnx-community/gemma-3n-E2B-it-ONNX">gemma-3n-E2B-it-ONNX (not working)</option>
49
  </select>
50
  </label>
51
 
src/main.js CHANGED
@@ -107,7 +107,7 @@ async function loadDeviceModel() {
107
  if (progress && progress.loaded && progress.total) {
108
  const percent = ((progress.loaded / progress.total) * 100).toFixed(1);
109
  loadingBar.style.width = percent + '%';
110
- loadingText.textContent = `Loading: ${percent}% (${progress.loaded}/${progress.total} bytes)`;
111
  } else if (progress && progress.status) {
112
  loadingText.textContent = progress.status;
113
  } else if (typeof progress === 'string') {
 
107
  if (progress && progress.loaded && progress.total) {
108
  const percent = ((progress.loaded / progress.total) * 100).toFixed(1);
109
  loadingBar.style.width = percent + '%';
110
+ loadingText.textContent = `Loading: ${percent}% (${(progress.loaded / (1024 ** 3)).toFixed(2)} GB / ${(progress.total / (1024 ** 3)).toFixed(2)} GB)`;
111
  } else if (progress && progress.status) {
112
  loadingText.textContent = progress.status;
113
  } else if (typeof progress === 'string') {
src/services/onDeviceService.js CHANGED
@@ -38,7 +38,7 @@ export class OnDeviceService {
38
  console.log(`[Model Loading] Progress:`, progress);
39
  }
40
  };
41
- // Xenova's pipeline API (ES module)
42
  this._model = await pipeline('text-generation', this.modelName, {
43
  progress_callback: progressCb || defaultProgressCb,
44
  device: 'webgpu', // run on WebGPU if available
 
38
  console.log(`[Model Loading] Progress:`, progress);
39
  }
40
  };
41
+
42
  this._model = await pipeline('text-generation', this.modelName, {
43
  progress_callback: progressCb || defaultProgressCb,
44
  device: 'webgpu', // run on WebGPU if available
src/utils.js CHANGED
@@ -30,7 +30,7 @@ export function logTo(el, evt) {
30
  <td>${evt.route}</td>
31
  <td>${evt.latency.toFixed(2)}ms</td>
32
  <td title="${evt.job.prompt}">${evt.job.prompt.substring(0, 30)}...</td>
33
- <td title="${evt.response.answer}">${evt.response.answer.substring(0, 30)}...</td>
34
  <td>${evt.evalRes.exactMatch}</td>
35
  `;
36
  el.appendChild(row);
 
30
  <td>${evt.route}</td>
31
  <td>${evt.latency.toFixed(2)}ms</td>
32
  <td title="${evt.job.prompt}">${evt.job.prompt.substring(0, 30)}...</td>
33
+ <td title="${evt.response.answer}">${evt.response.answer.substring(0, 30)}</td>
34
  <td>${evt.evalRes.exactMatch}</td>
35
  `;
36
  el.appendChild(row);