Docker-сервис, выбор основы и сравнение моделей, сборщик датасета
docker / build (push) Failing after 39s
docker / build (push) Failing after 39s
- Docker: Dockerfile (CPU), compose с FlareSolverr, настройка через DUB_* переменные, токен доступа к /predict, tools/pack_models.py, workflow Gitea Actions, docs/docker.md - Модель грузится офлайн (config.json рядом с весами); общий код вынесен в src/spans.py, сервису не нужны sklearn/matplotlib/pandas - Обучение: профили tiny2/base/large/modern, запуски в models/runs, реестр и честное сравнение на одной тестовой выборке (src/runs.py), пункт меню «Модели» - Датасет: язык и аудио-параметры дорожек, 18+ по строкам «Аудио», ручные метки по ссылкам, переиндексация сохранённого HTML, параллельная сборка, сбалансированная выборка - Тексты страниц (data/pages) больше не хранятся в git Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
d155b8584b
commit
efc9a4f56a
411 files changed
+87495
-27363
No files matched your search
@@ -0,0 +1,37 @@
|
||||
JSON.stringify((() => {
|
||||
// Снимок страницы «как на сайте»: UTF-8, <base>, таблицы стилей вынесены в css[]
|
||||
const root = document.documentElement.cloneNode(true);
|
||||
const css = [];
|
||||
const orig = [...document.querySelectorAll('link[rel~="stylesheet"]')];
|
||||
const copy = [...root.querySelectorAll('link[rel~="stylesheet"]')];
|
||||
orig.forEach((l, i) => {
|
||||
try {
|
||||
const rules = l.sheet && l.sheet.cssRules;
|
||||
if (!rules) return;
|
||||
let text = '';
|
||||
for (const r of rules) text += r.cssText + '\n';
|
||||
text = text.replace(/url\((['"]?)(?!data:|https?:|\/\/)([^)'"]+)\1\)/g, (m, q, u) => {
|
||||
try { return 'url(' + q + new URL(u, l.sheet.href) + q + ')'; } catch (e) { return m; }
|
||||
});
|
||||
css.push(text);
|
||||
copy[i].setAttribute('href', '@@CSS' + (css.length - 1) + '@@');
|
||||
} catch (e) { /* таблица чужого домена: оставляем исходную ссылку */ }
|
||||
});
|
||||
root.querySelectorAll('script').forEach(x => x.remove()); // страница из файла не должна уходить на сайт
|
||||
const head = root.querySelector('head');
|
||||
root.querySelectorAll('meta[charset], meta[http-equiv="Content-Type" i]').forEach(m => m.remove());
|
||||
if (head) {
|
||||
const meta = document.createElement('meta');
|
||||
meta.setAttribute('charset', 'utf-8');
|
||||
head.insertBefore(meta, head.firstChild);
|
||||
const old = root.querySelector('base');
|
||||
if (old) { // «//host/path» в файле стал бы file://host/…
|
||||
old.setAttribute('href', document.baseURI);
|
||||
} else {
|
||||
const base = document.createElement('base');
|
||||
base.href = document.baseURI;
|
||||
head.insertBefore(base, meta.nextSibling);
|
||||
}
|
||||
}
|
||||
return { html: '<!DOCTYPE html>' + root.outerHTML, css };
|
||||
})())
|
||||
Reference in new issue
Block a user