Adjust import versions.
Browse files- chat-copil-web.html +1 -1
- chat-full.js +1 -13
chat-copil-web.html
CHANGED
|
@@ -123,7 +123,7 @@
|
|
| 123 |
|
| 124 |
let pipeline, AutoTokenizer;
|
| 125 |
try {
|
| 126 |
-
const lib = await import('https://
|
| 127 |
pipeline = lib.pipeline;
|
| 128 |
AutoTokenizer = lib.AutoTokenizer;
|
| 129 |
} catch (err) {
|
|
|
|
| 123 |
|
| 124 |
let pipeline, AutoTokenizer;
|
| 125 |
try {
|
| 126 |
+
const lib = await import('https://cdn.jsdelivr.net/npm/@huggingface/transformers@3.7.1');
|
| 127 |
pipeline = lib.pipeline;
|
| 128 |
AutoTokenizer = lib.AutoTokenizer;
|
| 129 |
} catch (err) {
|
chat-full.js
CHANGED
|
@@ -70,7 +70,7 @@ async function loadTransformers() {
|
|
| 70 |
if (transformers) return transformers;
|
| 71 |
try {
|
| 72 |
pushMsg("sys", "[debug] Завантаження transformers.js...");
|
| 73 |
-
transformers = await import('https://cdn.jsdelivr.net/npm/@
|
| 74 |
pushMsg("sys", "[debug] transformers.js успішно завантажено");
|
| 75 |
return transformers;
|
| 76 |
} catch (err) {
|
|
@@ -206,18 +206,6 @@ window.onerror = function (msg, url, line, col, error) {
|
|
| 206 |
return false;
|
| 207 |
};
|
| 208 |
|
| 209 |
-
// Оновлення <title> і DOM header коротким описом змін у коді
|
| 210 |
-
function updateTitleWithChange(description) {
|
| 211 |
-
const words = description.split(/\s+/).filter(Boolean).slice(0, 4).join(' ');
|
| 212 |
-
const base = 'Локальний чат';
|
| 213 |
-
document.title = `${base} — ${words}`;
|
| 214 |
-
const h1 = document.querySelector('header h1');
|
| 215 |
-
if (h1) h1.textContent = `${base} — ${words}`;
|
| 216 |
-
}
|
| 217 |
-
|
| 218 |
-
// Викликати після змін у коді:
|
| 219 |
-
updateTitleWithChange('Динамічний import transformers debug');
|
| 220 |
-
|
| 221 |
// DEBUG: перевірка виконання модуля
|
| 222 |
try {
|
| 223 |
const el = document.querySelector('#messages');
|
|
|
|
| 70 |
if (transformers) return transformers;
|
| 71 |
try {
|
| 72 |
pushMsg("sys", "[debug] Завантаження transformers.js...");
|
| 73 |
+
transformers = await import('https://cdn.jsdelivr.net/npm/@huggingface/transformers@3.7.1');
|
| 74 |
pushMsg("sys", "[debug] transformers.js успішно завантажено");
|
| 75 |
return transformers;
|
| 76 |
} catch (err) {
|
|
|
|
| 206 |
return false;
|
| 207 |
};
|
| 208 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 209 |
// DEBUG: перевірка виконання модуля
|
| 210 |
try {
|
| 211 |
const el = document.querySelector('#messages');
|