Spaces:
Runtime error
Runtime error
Update index.html
Browse files- index.html +2 -4
index.html
CHANGED
|
@@ -122,7 +122,7 @@
|
|
| 122 |
|
| 123 |
// --- Backend config (no cross-origin isolation) ---
|
| 124 |
env.localModelPath = ""; // important: empty string, not null
|
| 125 |
-
env.allowRemoteModels =
|
| 126 |
env.useBrowserCache = true;
|
| 127 |
env.backends.onnx.webgpu = { enabled: false };
|
| 128 |
env.backends.onnx.preferredBackend = "wasm";
|
|
@@ -294,7 +294,6 @@
|
|
| 294 |
// Load tokenizer directly from your local folder (absolute URL)
|
| 295 |
tokenizer = await AutoTokenizer.from_pretrained(MODELS.qwen.local_href, {
|
| 296 |
progress_callback: onProgress,
|
| 297 |
-
local_files_only: true,
|
| 298 |
});
|
| 299 |
} else {
|
| 300 |
tokenizer = await AutoTokenizer.from_pretrained(MODELS.distilgpt2.remote_repo, {
|
|
@@ -317,7 +316,6 @@
|
|
| 317 |
file_name: MODELS.qwen.onnx_file,
|
| 318 |
progress_callback: onProgress,
|
| 319 |
config: QWEN3_CONFIG_FIX,
|
| 320 |
-
local_files_only: true,
|
| 321 |
});
|
| 322 |
} else {
|
| 323 |
model = await AutoModelForCausalLM.from_pretrained(MODELS.distilgpt2.remote_repo, {
|
|
@@ -438,7 +436,7 @@
|
|
| 438 |
topkSel.addEventListener('change', predict);
|
| 439 |
demoBtn.addEventListener('click', () => { textEl.value = "Twinkle, twinkle, little "; predict(); });
|
| 440 |
modelSel.addEventListener('change', async (e) => {
|
| 441 |
-
env.allowRemoteModels =
|
| 442 |
await loadModel(e.target.value);
|
| 443 |
predict();
|
| 444 |
});
|
|
|
|
| 122 |
|
| 123 |
// --- Backend config (no cross-origin isolation) ---
|
| 124 |
env.localModelPath = ""; // important: empty string, not null
|
| 125 |
+
env.allowRemoteModels = true;
|
| 126 |
env.useBrowserCache = true;
|
| 127 |
env.backends.onnx.webgpu = { enabled: false };
|
| 128 |
env.backends.onnx.preferredBackend = "wasm";
|
|
|
|
| 294 |
// Load tokenizer directly from your local folder (absolute URL)
|
| 295 |
tokenizer = await AutoTokenizer.from_pretrained(MODELS.qwen.local_href, {
|
| 296 |
progress_callback: onProgress,
|
|
|
|
| 297 |
});
|
| 298 |
} else {
|
| 299 |
tokenizer = await AutoTokenizer.from_pretrained(MODELS.distilgpt2.remote_repo, {
|
|
|
|
| 316 |
file_name: MODELS.qwen.onnx_file,
|
| 317 |
progress_callback: onProgress,
|
| 318 |
config: QWEN3_CONFIG_FIX,
|
|
|
|
| 319 |
});
|
| 320 |
} else {
|
| 321 |
model = await AutoModelForCausalLM.from_pretrained(MODELS.distilgpt2.remote_repo, {
|
|
|
|
| 436 |
topkSel.addEventListener('change', predict);
|
| 437 |
demoBtn.addEventListener('click', () => { textEl.value = "Twinkle, twinkle, little "; predict(); });
|
| 438 |
modelSel.addEventListener('change', async (e) => {
|
| 439 |
+
env.allowRemoteModels = true;
|
| 440 |
await loadModel(e.target.value);
|
| 441 |
predict();
|
| 442 |
});
|