Spaces:
Running
Running
Commit
·
3533d0c
1
Parent(s):
759f90d
feat: more context window length options
Browse files- dist/index.js +0 -0
- index.html +8 -2
- src/index.js +3 -5
dist/index.js
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|
index.html
CHANGED
|
@@ -36,8 +36,14 @@
|
|
| 36 |
<div class="form-group">
|
| 37 |
<label for="context">Context Window:</label>
|
| 38 |
<select id="context" name="context">
|
| 39 |
-
<option value="
|
| 40 |
-
<option value="">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 41 |
</select>
|
| 42 |
</div>
|
| 43 |
|
|
|
|
| 36 |
<div class="form-group">
|
| 37 |
<label for="context">Context Window:</label>
|
| 38 |
<select id="context" name="context">
|
| 39 |
+
<option value="1024">1k</option>
|
| 40 |
+
<option value="2048">2k</option>
|
| 41 |
+
<option value="4096">4k</option>
|
| 42 |
+
<option value="8192">8k</option>
|
| 43 |
+
<option value="16384">16k</option>
|
| 44 |
+
<option value="32768">32k</option>
|
| 45 |
+
<option value="65536">64k</option>
|
| 46 |
+
<option value="131072">128k</option>
|
| 47 |
</select>
|
| 48 |
</div>
|
| 49 |
|
src/index.js
CHANGED
|
@@ -44,22 +44,20 @@ engine.setInitProgressCallback(updateEngineInitProgressCallback);
|
|
| 44 |
|
| 45 |
async function initializeWebLLMEngine() {
|
| 46 |
const quantization = document.getElementById("quantization").value;
|
| 47 |
-
const
|
| 48 |
const temperature = parseFloat(document.getElementById("temperature").value);
|
| 49 |
const top_p = parseFloat(document.getElementById("top_p").value);
|
| 50 |
const presence_penalty = parseFloat(document.getElementById("presence_penalty").value);
|
| 51 |
const frequency_penalty = parseFloat(document.getElementById("frequency_penalty").value);
|
| 52 |
|
| 53 |
document.getElementById("download-status").classList.remove("hidden");
|
| 54 |
-
|
| 55 |
-
if (context_window) {
|
| 56 |
-
selectedModel += "-" + context_window;
|
| 57 |
-
}
|
| 58 |
const config = {
|
| 59 |
temperature,
|
| 60 |
top_p,
|
| 61 |
frequency_penalty,
|
| 62 |
presence_penalty,
|
|
|
|
| 63 |
};
|
| 64 |
console.log(`Loading Model: ${selectedModel}`);
|
| 65 |
console.log(`Config: ${Object.toString(config)}`);
|
|
|
|
| 44 |
|
| 45 |
async function initializeWebLLMEngine() {
|
| 46 |
const quantization = document.getElementById("quantization").value;
|
| 47 |
+
const context_window_size = parseInt(document.getElementById("context").value);
|
| 48 |
const temperature = parseFloat(document.getElementById("temperature").value);
|
| 49 |
const top_p = parseFloat(document.getElementById("top_p").value);
|
| 50 |
const presence_penalty = parseFloat(document.getElementById("presence_penalty").value);
|
| 51 |
const frequency_penalty = parseFloat(document.getElementById("frequency_penalty").value);
|
| 52 |
|
| 53 |
document.getElementById("download-status").classList.remove("hidden");
|
| 54 |
+
const selectedModel = `Phi-3.5-mini-instruct-${quantization}_1-MLC`;
|
|
|
|
|
|
|
|
|
|
| 55 |
const config = {
|
| 56 |
temperature,
|
| 57 |
top_p,
|
| 58 |
frequency_penalty,
|
| 59 |
presence_penalty,
|
| 60 |
+
context_window_size,
|
| 61 |
};
|
| 62 |
console.log(`Loading Model: ${selectedModel}`);
|
| 63 |
console.log(`Config: ${Object.toString(config)}`);
|