odant-work 1.0.52 → 1.0.54
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/#system/package-manifest.json +14 -14
- package/MODELS/$ai/$folder/$class/$ai/class.js +31 -0
- package/MODELS/$ai/$folder/$class/$ai/handlers/pages/form/trainer/$handler/trainer.js +78 -7
- package/MODELS/$ai/$folder/$class/$provider/handlers/pages/form/trainer/$handler/trainer.js +11 -7
- package/package.json +1 -1
- package/sources/data/progress.md +8 -0
- package/sources/modules/agent/voice.js +3 -0
- package/sources/modules/trainer/huggingface.js +32 -4
- package/sources/modules/trainer/index.js +107 -4
- package/sources/modules/trainer/local-engine.js +113 -19
- package/sources/modules/trainer/paths.js +20 -13
- package/sources/modules/trainer/worker/local_infer_worker.py +337 -5
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"packageName": "odant-work",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.54",
|
|
4
4
|
"createdAt": 1794916599757,
|
|
5
|
-
"updatedAt":
|
|
5
|
+
"updatedAt": 1795083151882,
|
|
6
6
|
"files": {
|
|
7
7
|
"run.mjs": "f8918c612e8641e9beee06221be6680aa6fd21f25468451f2ac857fd51772266",
|
|
8
|
-
"package.json": "
|
|
9
|
-
"package-lock.json": "
|
|
8
|
+
"package.json": "d9d6393118685a217aca13be988b2312e2bebe1d421938d984dfe7120a38135e",
|
|
9
|
+
"package-lock.json": "d07bfc8bca803645c90d360e30c812db901b28731bc5368b25f8121d178d736f",
|
|
10
10
|
"sources/client/class.js": "c3fb8f143fc83aaa2df1ddeddd412d2d4dfe88656578095babe2df34fb3b3922",
|
|
11
11
|
"sources/client/field.js": "ffdd50fa8b6ec515cc42da5fca96658ff2b20e274601a1f926e0031372467a19",
|
|
12
12
|
"sources/client/file.js": "667101d75fa30840370d5be232e518aaac7c1fd52ca05a12da560eef6c0848b0",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"sources/data/objects.js": "23f51d5b00cd766fe27879b874738bc9bd9056bd6e27285fb7a52926c0dbc6a8",
|
|
27
27
|
"sources/data/posting.js": "6595bb9ec632539ae7629504db327d25a491e61c1cdc598bb43d08ea0d45548d",
|
|
28
28
|
"sources/data/print.js": "704f0f2fc80c6466a4196e4650d763150cf9b592eab14ea67ece85d51100107c",
|
|
29
|
-
"sources/data/progress.md": "
|
|
29
|
+
"sources/data/progress.md": "95bf7a85a123b533474bf52e0440abd50ab43d813b91030f98bf7a1564f0b30a",
|
|
30
30
|
"sources/data/readme.md": "593fa2ae07aa91bc26d7542275da6953a9cd419240a9a49e00cb62fb9d5d8e36",
|
|
31
31
|
"sources/data/reports.js": "0330f404860fe2589a7d46a2f0fe690ca23249bd841a062a26718742d4fd11d6",
|
|
32
32
|
"sources/data/schema.js": "1c994f9adb76c156dc86601dd6b1046376b66549b041e1a58aa1727b5476bdbe",
|
|
@@ -111,7 +111,7 @@
|
|
|
111
111
|
"sources/modules/agent/types.d.ts": "9d47168bb9fefb1d7c5506afb263c6a6f2e3609602ee78e50c98c02bc052831f",
|
|
112
112
|
"sources/modules/agent/undo.js": "e46f3f1172c6d6e4055332bada74c546c0b0a0e585f1c96eac9b40e4d35b8544",
|
|
113
113
|
"sources/modules/agent/util.js": "9bca6569c16cdfed0134dfec0c99347b3e999692afdc35719886f6083fed87c5",
|
|
114
|
-
"sources/modules/agent/voice.js": "
|
|
114
|
+
"sources/modules/agent/voice.js": "156b8863d43a0af261bcd41ad9b91e084e4f13a796406d5ba2db240aadc08446",
|
|
115
115
|
"sources/modules/ai-schema.js": "84ecc7a872dec42e521f9e05366f053e36ae19b185f35c552b945157f95c66f4",
|
|
116
116
|
"sources/modules/bridge/chrome.js": "3bbba8c1726ef8341918bf94d9542093d47e57ec5364f600e863fe2500342e37",
|
|
117
117
|
"sources/modules/bridge/hub.js": "4398d503ad2581fad763ec2f56a6893cd00ecc6f0c0af42523f77de43c4e5f45",
|
|
@@ -177,15 +177,15 @@
|
|
|
177
177
|
"sources/modules/trainer/dataset.js": "e631e1feda2958cf93436cb48a331958d7b029aa52bd42247865e87504b642f7",
|
|
178
178
|
"sources/modules/trainer/downloader.js": "d9e96cb07e7bf64386558be8c2265c482af35a513f42954250add6d5fc87bdc4",
|
|
179
179
|
"sources/modules/trainer/halogen.js": "f2c8f09b756f12f0c81ceab9c283464e6ffe38325675e888c75c8e5954e4cd22",
|
|
180
|
-
"sources/modules/trainer/huggingface.js": "
|
|
181
|
-
"sources/modules/trainer/index.js": "
|
|
182
|
-
"sources/modules/trainer/local-engine.js": "
|
|
183
|
-
"sources/modules/trainer/paths.js": "
|
|
180
|
+
"sources/modules/trainer/huggingface.js": "8ad8d01b7d2267e8185da86f223479ac3b8333ea76c864368bb22b3c41d0bdf8",
|
|
181
|
+
"sources/modules/trainer/index.js": "323340c266ebdc974d42ab5c43e0045ce9433981dcefc0ad573e7a783eec6170",
|
|
182
|
+
"sources/modules/trainer/local-engine.js": "0a9bf2b8358b67553728faa5e6c589dc54e923c2afd9258ba9ef75da3b03754f",
|
|
183
|
+
"sources/modules/trainer/paths.js": "d0bdfd0f00f2994b513e64bf7b60327c345cc699dbe671b83b2439017ae7230c",
|
|
184
184
|
"sources/modules/trainer/providers.js": "56ffd2de03449ecaa13751a7e82c615cf5f84e6f02bb0b34c4432c3d85db28da",
|
|
185
185
|
"sources/modules/trainer/runner.js": "328843672fe0c1bd7e8c35c2e25285c31a9f749e04814e64c32e8cae74086024",
|
|
186
186
|
"sources/modules/trainer/tar-stream.js": "52f1739579a01818b53d04a93fd05a91c49a0716019f309a6fca951ba112794f",
|
|
187
187
|
"sources/modules/trainer/transfer.js": "2c603d538e0f85e1794e2f304081fac136f0ff72f85d8b00c2141c7402b3a1fb",
|
|
188
|
-
"sources/modules/trainer/worker/local_infer_worker.py": "
|
|
188
|
+
"sources/modules/trainer/worker/local_infer_worker.py": "a6248d4d372e8ba7eb432786475783fc3f6f57feb9d6ead49392300d771f3201",
|
|
189
189
|
"sources/modules/trainer/worker/unsloth_train.py": "7774d94ffa6f60eed20c57a8dfdc12621d5d9f74d594c605dff32ff70e321e33",
|
|
190
190
|
"sources/modules/user-profile/user-profile.js": "5c8fd002809848b204aee83a44161375e8144bffcc048fde748f4f778162bbef",
|
|
191
191
|
"sources/modules/user-profile/user-token.js": "3797685232684e9e80261a2e63f70cbff4ef1bcc3ded6f755800804e9848d7d9",
|
|
@@ -974,15 +974,15 @@
|
|
|
974
974
|
"MODULES/Register/STRUCTS/Банковский счёт/$struct/class.js": "166ffafd1c7d1609b174ae7766e77842e6294c6902baabe787225a2eeb026cce",
|
|
975
975
|
"MODULES/Register/STRUCTS/Единица измерения/$struct/class.js": "dd0982281ed782d23afd80d5985b79aa65c6acbe58dc080f943840ea798000b0",
|
|
976
976
|
"MODULES/Register/STRUCTS/Паспорт/$struct/class.js": "4a50808e4db7741b0384a775177545d71686a680ccda7ef0ec68bf81f9c988b5",
|
|
977
|
-
"MODELS/$ai/$folder/$class/$ai/class.js": "
|
|
977
|
+
"MODELS/$ai/$folder/$class/$ai/class.js": "766a73b4e110df0643edb2609e4bf46250e21c636ae6e86417147b234aa87c30",
|
|
978
978
|
"MODELS/$ai/$folder/$class/$ai/handlers/pages/form/trainer/$handler/class.js": "fe5ba834156495c28a34acd4b70a6b6b3bdfccb67ec7bf99e92a292afbb66d19",
|
|
979
|
-
"MODELS/$ai/$folder/$class/$ai/handlers/pages/form/trainer/$handler/trainer.js": "
|
|
979
|
+
"MODELS/$ai/$folder/$class/$ai/handlers/pages/form/trainer/$handler/trainer.js": "b7ff439e368dcb96cac9d428492dce17ca28fa15b0616baab2e22ca6a51e2e27",
|
|
980
980
|
"MODELS/$ai/$folder/$class/$ai/methods/chat/$method/class.js": "02fbb40d8ce93fbf568a6a8036c199e2af815be3d63d81f815aeb1da999db717",
|
|
981
981
|
"MODELS/$ai/$folder/$class/$provider/class.js": "069073501b93a95bb9d77e59ce71e53c7a8bcab2564c391b551f68a2453ac486",
|
|
982
982
|
"MODELS/$ai/$folder/$class/$provider/handlers/pages/form/provider/$handler/class.js": "8d327820cefd696d351ac4fa7998994039e4d57ef7a9f8ae297209e4dd1b0a9e",
|
|
983
983
|
"MODELS/$ai/$folder/$class/$provider/handlers/pages/form/provider/$handler/provider.js": "b9ddf0040a9cd12e0dacd2dd3a61a1f0e62686cc664d02ef446326bc3991f4ce",
|
|
984
984
|
"MODELS/$ai/$folder/$class/$provider/handlers/pages/form/trainer/$handler/class.js": "06b279a1c053deb37dd7401c84df7f9370309b8dfbd35b368ab1bab4f635cb3f",
|
|
985
|
-
"MODELS/$ai/$folder/$class/$provider/handlers/pages/form/trainer/$handler/trainer.js": "
|
|
985
|
+
"MODELS/$ai/$folder/$class/$provider/handlers/pages/form/trainer/$handler/trainer.js": "7b1cb7c5eec184205c8cef43c71fe6b9dfb7d57287d43ccb34fe107d0848e951",
|
|
986
986
|
"MODELS/$ai/$folder/$class/$provider/readme.md": "d6ceef2010231ab121510c3d3f35630dd7009a069c7723f6673a0e264799b227",
|
|
987
987
|
"MODELS/$ai/class.js": "54e1bbbde88f8b1f272ff7f5cad87243407591748a44719b7ec90ae2b4962de7",
|
|
988
988
|
"MODELS/$ai/readme.md": "90d70305a2c85312282cf67cc468a0f0b417495cb3d5b3d2ca60c6f44b81cb77",
|
|
@@ -581,6 +581,37 @@ export default {
|
|
|
581
581
|
throw new Error('generateImage: не удалось получить картинку (' + lastErr + ')');
|
|
582
582
|
},
|
|
583
583
|
|
|
584
|
+
/**
|
|
585
|
+
* Генерация видеоролика по текстовому описанию (capabilities `video`).
|
|
586
|
+
* Локальный движок WORK возвращает base64 MP4/GIF и метаданные.
|
|
587
|
+
* @param {object} [params]
|
|
588
|
+
* @param {string} params.prompt Текстовый сценарий видео
|
|
589
|
+
* @returns {Promise<{ mime: string, base64: string, frames?: number, fps?: number, model?: string }>}
|
|
590
|
+
*/
|
|
591
|
+
async generateVideo(params = {}) {
|
|
592
|
+
const ai = params.$ai || this;
|
|
593
|
+
if (!hasCap(ai, 'video'))
|
|
594
|
+
throw new Error('generateVideo: у модели нет capabilities video');
|
|
595
|
+
if (isLocalDirectModel(ai) && typeof WORK?.localEngine?.generateVideo === 'function')
|
|
596
|
+
return WORK.localEngine.generateVideo(ai, params);
|
|
597
|
+
throw new Error('generateVideo: поддерживается только локальными видео-моделями в /MODELS/Local');
|
|
598
|
+
},
|
|
599
|
+
|
|
600
|
+
/**
|
|
601
|
+
* Генерация музыки и звуковых эффектов по текстовому описанию (capabilities `music`).
|
|
602
|
+
* @param {object} [params]
|
|
603
|
+
* @param {string} params.prompt Описание мелодии или звука
|
|
604
|
+
* @returns {Promise<{ mime: string, audioBase64: string, sampleRate?: number, model?: string }>}
|
|
605
|
+
*/
|
|
606
|
+
async generateMusic(params = {}) {
|
|
607
|
+
const ai = params.$ai || this;
|
|
608
|
+
if (!hasCap(ai, 'music'))
|
|
609
|
+
throw new Error('generateMusic: у модели нет capabilities music');
|
|
610
|
+
if (isLocalDirectModel(ai) && typeof WORK?.localEngine?.generateMusic === 'function')
|
|
611
|
+
return WORK.localEngine.generateMusic(ai, params);
|
|
612
|
+
throw new Error('generateMusic: поддерживается только локальными музыкальными моделями в /MODELS/Local');
|
|
613
|
+
},
|
|
614
|
+
|
|
584
615
|
/**
|
|
585
616
|
* Синтез речи (capabilities `tts`): OpenAI-совместимый POST {origin}/v1/audio/speech → WAV (Buffer).
|
|
586
617
|
* Поля модели: voice ('default'), ttsTask ('VoiceDesign' | 'CustomVoice' | 'Base'), instructions (описание голоса),
|
|
@@ -285,7 +285,14 @@ export default {
|
|
|
285
285
|
</div>
|
|
286
286
|
<div class="vertical" style="gap:8px;" ~if="testModality === 'tts'">
|
|
287
287
|
<textarea rows="2" :value="testTtsText" placeholder="Текст для озвучивания…" @input="testTtsText = $this.value"></textarea>
|
|
288
|
-
<div class="chips" style="gap:6px;" ~if="ttsKind
|
|
288
|
+
<div class="chips" style="gap:6px;" ~if="ttsKind === 'piper'">
|
|
289
|
+
<button type="button" class="btn" ~for="piperVoicePresets"
|
|
290
|
+
:style="testPiperVoice === $for.item.speaker ? 'border-color:var(--accent-color,#4f46e5);color:var(--accent-color,#4f46e5);' : ''"
|
|
291
|
+
@tap="testPiperVoice = $for.item.speaker">
|
|
292
|
+
{{$for.item.label}}
|
|
293
|
+
</button>
|
|
294
|
+
</div>
|
|
295
|
+
<div class="chips" style="gap:6px;" ~if="ttsKind !== 'base' && ttsKind !== 'piper'">
|
|
289
296
|
<button type="button" class="btn" ~for="ttsVoicePresets"
|
|
290
297
|
:style="(isCustomVoice06B ? testTtsVoice === $for.item.speaker : testTtsInstructions === $for.item.value) ? 'border-color:var(--accent-color,#4f46e5);color:var(--accent-color,#4f46e5);' : ''"
|
|
291
298
|
@tap="selectTtsPreset($for.item)">
|
|
@@ -294,7 +301,7 @@ export default {
|
|
|
294
301
|
</div>
|
|
295
302
|
<textarea ~if="ttsKind === 'voice_design' || (ttsKind === 'custom_voice' && !isCustomVoice06B)" rows="2" :value="testTtsInstructions" placeholder="Описание голоса и манеры (instruct): например «Мужской баритон, спокойная деловая интонация»…" @input="testTtsInstructions = $this.value"></textarea>
|
|
296
303
|
<input ~if="ttsKind === 'custom_voice'" :value="testTtsVoice" placeholder="Голос (speaker): Ryan, Aiden, Dylan, Serena, Vivian…" @input="testTtsVoice = $this.value">
|
|
297
|
-
<div ~if="ttsKind === 'base'" style="font-size:12px;opacity:0.8;">Модель Base клонирует голос: для синтеза нужна эталонная запись (WAV) и её текст. Без эталона используйте VoiceDesign или
|
|
304
|
+
<div ~if="ttsKind === 'base'" style="font-size:12px;opacity:0.8;">Модель Base клонирует голос: для синтеза нужна эталонная запись (WAV) и её текст. Без эталона используйте VoiceDesign, CustomVoice или Piper.</div>
|
|
298
305
|
</div>
|
|
299
306
|
<div class="vertical" style="gap:8px;" ~if="testModality === 'stt'">
|
|
300
307
|
<div style="font-size:12px;opacity:0.8;">Можно загрузить WAV-файл или запустить автоматическую проверку встроенным тестовым аудиосигналом.</div>
|
|
@@ -303,6 +310,28 @@ export default {
|
|
|
303
310
|
<div class="vertical" style="gap:8px;" ~if="testModality === 'image'">
|
|
304
311
|
<textarea rows="2" :value="testImagePrompt" placeholder="Опишите изображение…" @input="testImagePrompt = $this.value"></textarea>
|
|
305
312
|
</div>
|
|
313
|
+
<div class="vertical" style="gap:8px;" ~if="testModality === 'video'">
|
|
314
|
+
<textarea rows="2" :value="testVideoPrompt" placeholder="Опишите видеоролик…" @input="testVideoPrompt = $this.value"></textarea>
|
|
315
|
+
<div class="toolbar" style="font-size:12px;">
|
|
316
|
+
<span style="opacity:0.75;">Длительность:</span>
|
|
317
|
+
<select @change="testVideoFrames = Number($this.value)" style="padding:4px 8px;border-radius:6px;border:1px solid var(--border-color,#cbd5e1);background:var(--content-background,#fff);color:inherit;">
|
|
318
|
+
<option value="17" :selected="testVideoFrames === 17">Быстрый тест (17 кадров, ~1 с)</option>
|
|
319
|
+
<option value="33" :selected="testVideoFrames === 33">Средний ролик (33 кадра, ~2 с)</option>
|
|
320
|
+
<option value="49" :selected="testVideoFrames === 49">Длинный ролик (49 кадров, ~3 с)</option>
|
|
321
|
+
</select>
|
|
322
|
+
</div>
|
|
323
|
+
</div>
|
|
324
|
+
<div class="vertical" style="gap:8px;" ~if="testModality === 'music'">
|
|
325
|
+
<textarea rows="2" :value="testMusicPrompt" placeholder="Опишите мелодию или звуковой эффект (лучше на английском)…" @input="testMusicPrompt = $this.value"></textarea>
|
|
326
|
+
<div class="toolbar" style="font-size:12px;">
|
|
327
|
+
<span style="opacity:0.75;">Длительность:</span>
|
|
328
|
+
<select @change="testMusicDuration = Number($this.value)" style="padding:4px 8px;border-radius:6px;border:1px solid var(--border-color,#cbd5e1);background:var(--content-background,#fff);color:inherit;">
|
|
329
|
+
<option value="4" :selected="testMusicDuration === 4">Короткий фрагмент (4 с)</option>
|
|
330
|
+
<option value="8" :selected="testMusicDuration === 8">Стандартный фрагмент (8 с)</option>
|
|
331
|
+
<option value="12" :selected="testMusicDuration === 12">Длинный фрагмент (12 с)</option>
|
|
332
|
+
</select>
|
|
333
|
+
</div>
|
|
334
|
+
</div>
|
|
306
335
|
<div class="vertical" style="gap:8px;" ~if="testModality === 'embed'">
|
|
307
336
|
<textarea rows="3" :value="testEmbedInput" placeholder="Строки для векторизации (по одной в строке)…" @input="testEmbedInput = $this.value"></textarea>
|
|
308
337
|
</div>
|
|
@@ -329,6 +358,8 @@ export default {
|
|
|
329
358
|
<div class="reply-box" ~if="testReply">{{testReply}}</div>
|
|
330
359
|
<audio controls ~if="testAudioUrl" :src="testAudioUrl" style="width:100%;"></audio>
|
|
331
360
|
<img ~if="testImageUrl" :src="testImageUrl" style="max-width:100%;max-height:360px;object-fit:contain;border-radius:6px;border:1px solid var(--border-color, #cbd5e1);">
|
|
361
|
+
<video controls autoplay loop muted ~if="testVideoUrl && !testVideoIsGif" :src="testVideoUrl" style="max-width:100%;max-height:360px;border-radius:6px;border:1px solid var(--border-color, #cbd5e1);background:#000;"></video>
|
|
362
|
+
<img ~if="testVideoUrl && testVideoIsGif" :src="testVideoUrl" style="max-width:100%;max-height:360px;object-fit:contain;border-radius:6px;border:1px solid var(--border-color, #cbd5e1);">
|
|
332
363
|
</div>
|
|
333
364
|
</div>
|
|
334
365
|
`,
|
|
@@ -342,6 +373,11 @@ export default {
|
|
|
342
373
|
testTtsText: 'Привет! Локальный синтез речи платформы WORK работает.',
|
|
343
374
|
testTtsInstructions: 'Мужской баритон, спокойная деловая интонация',
|
|
344
375
|
testTtsVoice: 'Ryan',
|
|
376
|
+
testPiperVoice: 'dmitri',
|
|
377
|
+
piperVoicePresets: [
|
|
378
|
+
{ label: 'Мужской (Дмитрий)', speaker: 'dmitri' },
|
|
379
|
+
{ label: 'Женский (Ирина)', speaker: 'irina' },
|
|
380
|
+
],
|
|
345
381
|
ttsVoicePresets: [
|
|
346
382
|
{ label: 'Мужской баритон', value: 'Мужской баритон, спокойная деловая интонация', speaker: 'Ryan' },
|
|
347
383
|
{ label: 'Мужской диктор', value: 'Мужской дикторский голос, глубокий уверенный тембр, чёткая дикция', speaker: 'Aiden' },
|
|
@@ -349,6 +385,10 @@ export default {
|
|
|
349
385
|
{ label: 'Женский живой', value: 'Женский живой энергичный голос, доброжелательная выразительная подача', speaker: 'Vivian' },
|
|
350
386
|
],
|
|
351
387
|
testImagePrompt: 'Минималистичная светлая 3D-иконка офисного здания в стиле современного UI',
|
|
388
|
+
testVideoPrompt: 'Камера плавно облетает современный светлый офис с панорамными окнами, мягкий утренний свет',
|
|
389
|
+
testVideoFrames: 17,
|
|
390
|
+
testMusicPrompt: 'Calm modern corporate background music, warm acoustic piano and soft electronic rhythm',
|
|
391
|
+
testMusicDuration: 6,
|
|
352
392
|
testEmbedInput: 'Учётная система WORK\nОборотно-сальдовая ведомость',
|
|
353
393
|
testRerankQuery: 'остатки на расчётном счёте 51',
|
|
354
394
|
testRerankDocs: 'Счёт 51 «Расчётные счета»: обороты и остатки денежных средств\nДоговор аренды офиса и коммунальные услуги',
|
|
@@ -356,6 +396,8 @@ export default {
|
|
|
356
396
|
testReply: '',
|
|
357
397
|
testAudioUrl: '',
|
|
358
398
|
testImageUrl: '',
|
|
399
|
+
testVideoUrl: '',
|
|
400
|
+
testVideoIsGif: false,
|
|
359
401
|
testMetricsLine: '',
|
|
360
402
|
testing: false,
|
|
361
403
|
busyAction: false,
|
|
@@ -373,6 +415,10 @@ export default {
|
|
|
373
415
|
return 'tts';
|
|
374
416
|
if (caps.includes('stt') || caps.includes('asr') || mod === 'stt' || mod === 'asr')
|
|
375
417
|
return 'stt';
|
|
418
|
+
if (caps.includes('music') || mod === 'music' || id.includes('musicgen') || id.includes('audioldm'))
|
|
419
|
+
return 'music';
|
|
420
|
+
if (caps.includes('video') || caps.includes('text-to-video') || mod === 'video')
|
|
421
|
+
return 'video';
|
|
376
422
|
if (caps.includes('image') || caps.includes('text-to-image') || mod === 'image')
|
|
377
423
|
return 'image';
|
|
378
424
|
if (caps.includes('rerank') || mod === 'rerank' || id.includes('rerank'))
|
|
@@ -385,6 +431,8 @@ export default {
|
|
|
385
431
|
const id = String(this.info?.id || this.resolvedModelId || '').toLowerCase();
|
|
386
432
|
const task = String(this.info?.DATA?.ttsTask || this.info?.ttsTask || '').toLowerCase();
|
|
387
433
|
const hay = `${id} ${task}`;
|
|
434
|
+
if (hay.includes('piper'))
|
|
435
|
+
return 'piper';
|
|
388
436
|
if (hay.includes('voicedesign') || hay.includes('voice_design'))
|
|
389
437
|
return 'voice_design';
|
|
390
438
|
if (hay.includes('customvoice') || hay.includes('custom_voice'))
|
|
@@ -412,6 +460,8 @@ export default {
|
|
|
412
460
|
tts: 'Синтез речи (TTS)',
|
|
413
461
|
stt: 'Распознавание речи (STT)',
|
|
414
462
|
image: 'Генерация изображений',
|
|
463
|
+
video: 'Генерация видео',
|
|
464
|
+
music: 'Генерация музыки и звука',
|
|
415
465
|
embed: 'Эмбеддинги (RAG)',
|
|
416
466
|
rerank: 'Реранкинг (RAG)',
|
|
417
467
|
};
|
|
@@ -423,6 +473,8 @@ export default {
|
|
|
423
473
|
tts: 'Озвучить фразу',
|
|
424
474
|
stt: 'Проверить распознавание',
|
|
425
475
|
image: 'Сгенерировать картинку',
|
|
476
|
+
video: 'Сгенерировать видео',
|
|
477
|
+
music: 'Сгенерировать музыку',
|
|
426
478
|
embed: 'Проверить эмбеддинги',
|
|
427
479
|
rerank: 'Проверить реранкинг',
|
|
428
480
|
};
|
|
@@ -617,6 +669,8 @@ export default {
|
|
|
617
669
|
this.testReply = '';
|
|
618
670
|
this.testAudioUrl = '';
|
|
619
671
|
this.testImageUrl = '';
|
|
672
|
+
this.testVideoUrl = '';
|
|
673
|
+
this.testVideoIsGif = false;
|
|
620
674
|
this.testMetricsLine = '';
|
|
621
675
|
this.provisionBanner = '';
|
|
622
676
|
|
|
@@ -647,15 +701,28 @@ export default {
|
|
|
647
701
|
}
|
|
648
702
|
else if (m === 'tts') {
|
|
649
703
|
body.text = this.testTtsText.trim();
|
|
650
|
-
if (
|
|
651
|
-
body.
|
|
652
|
-
|
|
653
|
-
|
|
704
|
+
if (this.ttsKind === 'piper') {
|
|
705
|
+
body.voice = this.testPiperVoice || 'dmitri';
|
|
706
|
+
}
|
|
707
|
+
else {
|
|
708
|
+
if (!this.isCustomVoice06B && this.testTtsInstructions.trim())
|
|
709
|
+
body.instructions = this.testTtsInstructions.trim();
|
|
710
|
+
if (this.ttsKind === 'custom_voice' && this.testTtsVoice.trim())
|
|
711
|
+
body.voice = this.testTtsVoice.trim();
|
|
712
|
+
}
|
|
654
713
|
}
|
|
655
714
|
else if (m === 'stt' && this.testSttBase64)
|
|
656
715
|
body.audioBase64 = this.testSttBase64;
|
|
657
716
|
else if (m === 'image')
|
|
658
717
|
body.prompt = this.testImagePrompt.trim();
|
|
718
|
+
else if (m === 'video') {
|
|
719
|
+
body.prompt = this.testVideoPrompt.trim();
|
|
720
|
+
body.numFrames = Number(this.testVideoFrames) || 17;
|
|
721
|
+
}
|
|
722
|
+
else if (m === 'music') {
|
|
723
|
+
body.prompt = this.testMusicPrompt.trim();
|
|
724
|
+
body.durationSec = Number(this.testMusicDuration) || 6;
|
|
725
|
+
}
|
|
659
726
|
else if (m === 'embed')
|
|
660
727
|
body.input = this.testEmbedInput.split(/\r?\n/).map(s => s.trim()).filter(Boolean);
|
|
661
728
|
else if (m === 'rerank') {
|
|
@@ -699,12 +766,16 @@ export default {
|
|
|
699
766
|
parts.push(res.summary);
|
|
700
767
|
this.testMetricsLine = parts.join(' · ');
|
|
701
768
|
|
|
702
|
-
if (m === 'tts' && res.audioBase64) {
|
|
769
|
+
if ((m === 'tts' || m === 'music') && res.audioBase64) {
|
|
703
770
|
this.testAudioUrl = 'data:audio/wav;base64,' + res.audioBase64;
|
|
704
771
|
}
|
|
705
772
|
else if (m === 'image' && res.base64) {
|
|
706
773
|
this.testImageUrl = `data:${res.mime || 'image/png'};base64,${res.base64}`;
|
|
707
774
|
}
|
|
775
|
+
else if (m === 'video' && res.base64) {
|
|
776
|
+
this.testVideoIsGif = String(res.mime || '').includes('gif');
|
|
777
|
+
this.testVideoUrl = `data:${res.mime || 'video/mp4'};base64,${res.base64}`;
|
|
778
|
+
}
|
|
708
779
|
else if (m === 'embed') {
|
|
709
780
|
this.testReply = `Получено векторов: ${res.count}, размерность: ${res.dimensions}`;
|
|
710
781
|
}
|
|
@@ -545,9 +545,10 @@ export default {
|
|
|
545
545
|
|
|
546
546
|
<!-- Состояние: доступна к установке -->
|
|
547
547
|
<div class="toolbar" ~if="$for.item.state === 'available'">
|
|
548
|
-
<span class="mem-tag" :title="$for.item.fit === 'too_large' ? 'Требуется больше памяти, чем доступно на этом ПК' : 'Подходит по памяти'">
|
|
549
|
-
<span class="dot" ~class="$for.item.fit === '
|
|
550
|
-
<span><span ~if="$for.item.device">{{$for.item.device}} · </span>~{{$for.item.ramGb
|
|
548
|
+
<span class="mem-tag" :title="$for.item.fitLabel || ($for.item.fit === 'too_large' ? 'Требуется больше памяти, чем доступно на этом ПК' : ($for.item.fit === 'unknown' ? 'Число параметров не указано в названии — размер уточнится при установке' : 'Подходит по памяти'))">
|
|
549
|
+
<span class="dot" ~class="$for.item.fit === 'optimal' ? 'on' : ($for.item.fit === 'inference_only' ? 'warn' : 'off')"></span>
|
|
550
|
+
<span ~if="$for.item.ramGb"><span ~if="$for.item.device">{{$for.item.device}} · </span>~{{$for.item.ramGb}} ГБ</span>
|
|
551
|
+
<span ~if="!$for.item.ramGb">размер не указан</span>
|
|
551
552
|
</span>
|
|
552
553
|
<button type="button" class="btn primary" @tap="installUnifiedModel($for.item)">Установить</button>
|
|
553
554
|
</div>
|
|
@@ -789,6 +790,7 @@ export default {
|
|
|
789
790
|
{ id: 'vlm', label: 'Зрение и Документы', icon: 'carbon:image-search' },
|
|
790
791
|
{ id: 'audio', label: 'Речь и Голос', icon: 'carbon:microphone' },
|
|
791
792
|
{ id: 'image', label: 'Картинки', icon: 'carbon:paint-brush' },
|
|
793
|
+
{ id: 'video', label: 'Видео', icon: 'av:videocam' },
|
|
792
794
|
{ id: 'embed', label: 'Поиск (RAG)', icon: 'carbon:search-locate' },
|
|
793
795
|
{ id: 'halo', label: 'Комплект Halo (128–192 ГБ)', icon: 'carbon:chip' },
|
|
794
796
|
];
|
|
@@ -933,11 +935,12 @@ export default {
|
|
|
933
935
|
// 4. Каталог Hugging Face
|
|
934
936
|
for (const item of this.hfModels || []) {
|
|
935
937
|
const short = String(item.id || '').split('/').pop();
|
|
936
|
-
|
|
938
|
+
const targetId = item.folderName || short || item.id;
|
|
939
|
+
if (findEntry(targetId, item.id) || (short && findEntry(short, item.id)))
|
|
937
940
|
continue;
|
|
938
941
|
list.push({
|
|
939
942
|
key: `hf:${item.id}`,
|
|
940
|
-
id:
|
|
943
|
+
id: targetId,
|
|
941
944
|
repoId: item.id,
|
|
942
945
|
label: item.modelName || item.id,
|
|
943
946
|
desc: item.whatItDoes || item.recommendedFor || '',
|
|
@@ -948,8 +951,9 @@ export default {
|
|
|
948
951
|
haloNodeName: item.haloNodeName || '',
|
|
949
952
|
state: 'available',
|
|
950
953
|
dotClass: 'off',
|
|
951
|
-
ramGb: item.ramRequiredGb ||
|
|
952
|
-
fit: item.fit || '
|
|
954
|
+
ramGb: Number(item.ramRequiredGb) || 0,
|
|
955
|
+
fit: item.fit || 'unknown',
|
|
956
|
+
fitLabel: item.fitLabel || '',
|
|
953
957
|
device: '',
|
|
954
958
|
download: null,
|
|
955
959
|
progressPct: 0,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "odant-work",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.54",
|
|
4
4
|
"description": "ODANT-WORK — платформа цифровой организации (встроенная система учёта, документооборот, управление процессами и приватный мультимодальный ИИ)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "sources/work.js",
|
package/sources/data/progress.md
CHANGED
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
# Прогресс: sources/data
|
|
2
2
|
|
|
3
3
|
## Последние изменения
|
|
4
|
+
- [~14:15, 19.11] Поддержка генерации музыки (`MusicGen` / `musicgen-medium`), честные ошибки весов в `localStreamChat` и корректная индикация неизвестного размера в каталоге HF (`sources/modules/trainer/{huggingface,local-engine,index}.js`, `sources/modules/trainer/worker/local_infer_worker.py`, `MODELS/$ai/$folder/$class/$ai/class.js`, `MODELS/$ai/$folder/$class/{$ai,$provider}/handlers/pages/form/trainer/$handler/trainer.js`, `tests/halogen-speculation.test.js`, `odant-work@1.0.54`):
|
|
5
|
+
- **Локальная генерация музыки (`handle_music`, `$ai.generateMusic`):** `local_infer_worker.py` загружает `MusicgenForConditionalGeneration` + `AutoProcessor` (поддержка `.bin` и `.safetensors` на GPU `cuda:0` с откатом на CPU) и возвращает WAV с автовыгрузкой по простою; в карточке `$ai` появились текстовый запрос, выбор длительности (`4 / 8 / 12 с`) и плеер `<audio>`.
|
|
6
|
+
- **Автоисправление устаревших `capabilities` и честные ошибки чата:** `trainer_model_info` автоматически исправляет ошибочные `['chat', 'stream']` у не-чат моделей (включая ранее скачанную `musicgen-medium`), а `localStreamChat` при наличии `wInsp.hasReadyWeights` больше не сообщает «веса не скачаны», а указывает реальную причину (`формат весов other` / не-чат модальность / отсутствие `tokenizer.json`).
|
|
7
|
+
- **Честная метка памяти в каталоге `/MODELS/Local`:** для моделей без числа параметров в названии (`MiniMax-H3`, `LTX-2.5` и др., `fit === 'unknown'`) убран фейковый фоллбэк `~4 ГБ` и жёлтая точка `warn` — вместо них отображается нейтральная метка `размер не указан`; жёлтая точка оставлена строго для `inference_only`.
|
|
8
|
+
- [~13:20, 19.11] Штатная поддержка сверхбыстрого `Piper TTS (RU)` (CPU/ONNX) и генерации видео (`LTX-Video-2B` / `Wan2.1-T2V`) (`sources/modules/trainer/{paths,huggingface,local-engine,index}.js`, `sources/modules/trainer/worker/local_infer_worker.py`, `sources/modules/agent/voice.js`, `MODELS/$ai/$folder/$class/{$ai,$provider}/handlers/pages/form/trainer/$handler/trainer.js`, `MODELS/$ai/$folder/$class/$ai/class.js`, `tests/halogen-speculation.test.js`, `odant-work@1.0.53`):
|
|
9
|
+
- **`Piper TTS RU` в 1 клик (`rhasspy/piper-voices` → `Piper-TTS-RU`, ~125 МБ):** при установке скачиваются только 4 файла двух русских голосов (`ru_RU-dmitri-medium` и `ru_RU-irina-medium`), `packagesForModality` ставит лёгкий `piper-tts` + `onnxruntime` без PyTorch, `local_infer_worker.py` (`_handle_tts_piper`) синтезирует WAV на CPU за ~0.15–0.4 с без нагрузки на GPU; в `agent/voice.js` Piper получает приоритет для голосового режима, а в карточке `$ai` появились кнопки выбора диктора (`Мужской (Дмитрий)` / `Женский (Ирина)`).
|
|
10
|
+
- **Генерация видео (`LTXPipeline` / `WanPipeline` + MP4/GIF):** добавлены `localGenerateVideo` (`local-engine.js`), `$ai.generateVideo` (`MODELS/.../$ai/class.js`), `handle_video` + `_encode_video_frames` в `local_infer_worker.py` (с авто-выгрузкой видео-диффузии по простою `WORK_IMAGE_IDLE_SEC` и нехватке RAM `< 20 ГБ`), фильтр **«Видео»** в `/MODELS/Local` и плеер `<video controls autoplay loop>` в карточке модели.
|
|
11
|
+
- **Учёт вложенных подпапок и `FLUX.1-schnell`:** `collectWeightDirRawEntriesSync` рекурсивно инспектирует подпапки `#weights/` до глубины 6, `detectBrokenWeightsLayout` учитывает конфиги `*.onnx.json` Piper без `.onnx_data`, а `handle_image` включает быстрый 4-шаговый режим (`guidance_scale=0.0`) также для `FLUX.1-schnell`.
|
|
4
12
|
- [~12:45, 19.11] Фикс подмены ответов `trainer_model_info` в `WORK.__bind` (исчезали `Формат весов`, `NPU (Ryzen AI)` и появлялась ложная `Спекуляция (MTP): Отключена`) и полировка `Qwen3-TTS 0.6B CustomVoice` (`sources/client/folder.js`, `MODELS/$ai/$folder/$class/$ai/handlers/pages/form/trainer/$handler/trainer.js`, `sources/modules/trainer/worker/local_infer_worker.py`, `tests/halogen-speculation.test.js`, `odant-work@1.0.52`):
|
|
5
13
|
- **Причина бага в карточке модели:** `trainer_model_info` возвращал объект с полем `path` (`/MODELS/Local/...`), поэтому `$folder.prototype.fetch` прогонял его через `WORK.__bind(res)`, превращая plain JSON-ответ в узел дерева `CORE.$class` и пряча `weightFormat`, `engineSetup`, `speculation`, `halogenOnline` в `.DATA`. При рендере шаблона срабатывал `_onEmpty`, возвращая truthy `Promise` (отсюда `Спекуляция (MTP): Отключена`, скрытый `NPU (Ryzen AI)` и исчезнувший `Формат весов`).
|
|
6
14
|
- **Исправление:** `trainer_*`, `provider_*`, `license_*` и `messenger_*` исключены из `WORK.__bind` в `sources/client/folder.js` (они возвращают чистые JSON-структуры, а не узлы дерева), плюс добавлена страховка распаковки `.DATA` в `form/trainer` `reload()`.
|
|
@@ -52,6 +52,9 @@ async function localVoiceModel(cap) {
|
|
|
52
52
|
if (!matches.length)
|
|
53
53
|
return null;
|
|
54
54
|
if (cap === 'tts' && matches.length > 1) {
|
|
55
|
+
const piper = matches.find(m => /piper/i.test(String(m.id || m.model || m.path || '')));
|
|
56
|
+
if (piper)
|
|
57
|
+
return piper;
|
|
55
58
|
const fast = matches.find(m => /0\.6b|customvoice|kokoro/i.test(String(m.id || m.model || m.path || '')));
|
|
56
59
|
if (fast)
|
|
57
60
|
return fast;
|
|
@@ -402,6 +402,29 @@ export const CURATED_HF_MODELS = Object.freeze([
|
|
|
402
402
|
downloads: 64000,
|
|
403
403
|
likes: 510,
|
|
404
404
|
},
|
|
405
|
+
{
|
|
406
|
+
id: 'rhasspy/piper-voices',
|
|
407
|
+
folderName: 'Piper-TTS-RU',
|
|
408
|
+
author: 'rhasspy',
|
|
409
|
+
modelName: 'Piper TTS RU (Мгновенный голос: Дмитрий + Ирина, CPU)',
|
|
410
|
+
modality: 'audio',
|
|
411
|
+
format: 'onnx',
|
|
412
|
+
paramsB: 0.06,
|
|
413
|
+
ramRequiredGb: 0.25,
|
|
414
|
+
trainRamGb: 0.5,
|
|
415
|
+
capabilities: ['tts', 'voice'],
|
|
416
|
+
files: [
|
|
417
|
+
'ru/ru_RU/dmitri/medium/ru_RU-dmitri-medium.onnx',
|
|
418
|
+
'ru/ru_RU/dmitri/medium/ru_RU-dmitri-medium.onnx.json',
|
|
419
|
+
'ru/ru_RU/irina/medium/ru_RU-irina-medium.onnx',
|
|
420
|
+
'ru/ru_RU/irina/medium/ru_RU-irina-medium.onnx.json',
|
|
421
|
+
],
|
|
422
|
+
whatItDoes: 'Сверхбыстрый локальный синтез русской речи на CPU (ONNX) за 0.15–0.4 с без нагрузки на GPU',
|
|
423
|
+
recommendedFor: 'Мгновенная озвучка в голосовом режиме WORK (~125 МБ за два русских голоса, работает на любом ПК)',
|
|
424
|
+
tags: ['audio', 'tts', 'text-to-speech', 'voice', 'piper', 'onnx', 'russian'],
|
|
425
|
+
downloads: 920000,
|
|
426
|
+
likes: 2150,
|
|
427
|
+
},
|
|
405
428
|
{
|
|
406
429
|
id: 'hexgrad/Kokoro-82M',
|
|
407
430
|
author: 'hexgrad',
|
|
@@ -660,7 +683,7 @@ export function evaluateModelFit(model, usableMemoryGb = 16) {
|
|
|
660
683
|
if (!infGb) {
|
|
661
684
|
return {
|
|
662
685
|
fit: 'unknown',
|
|
663
|
-
fitLabel: '
|
|
686
|
+
fitLabel: 'Число параметров не указано в названии — размер уточнится при установке',
|
|
664
687
|
canInfer: true,
|
|
665
688
|
canTrain: true,
|
|
666
689
|
};
|
|
@@ -707,7 +730,7 @@ export function resolveModelIcon({ repoId = '', modality = 'llm', capabilities =
|
|
|
707
730
|
const caps = Array.isArray(capabilities) ? capabilities : [];
|
|
708
731
|
if (caps.includes('stt'))
|
|
709
732
|
return 'carbon:microphone';
|
|
710
|
-
if (caps.includes('tts'))
|
|
733
|
+
if (caps.includes('tts') || caps.includes('music'))
|
|
711
734
|
return 'carbon:volume-up';
|
|
712
735
|
if (modality === 'video' || caps.includes('video'))
|
|
713
736
|
return 'av:videocam';
|
|
@@ -1151,10 +1174,12 @@ export async function registerLocalModelNode({
|
|
|
1151
1174
|
const aiDir = path.join(rootDir, 'MODELS', 'Local', safeName, '$ai');
|
|
1152
1175
|
await fsp.mkdir(aiDir, { recursive: true });
|
|
1153
1176
|
|
|
1177
|
+
const inferred = inferModalityAndCapabilities({ id: repoId || safeName });
|
|
1154
1178
|
const defaultCaps = modality === 'image' ? ['image']
|
|
1155
1179
|
: modality === 'video' ? ['video']
|
|
1156
1180
|
: modality === 'embed' ? ['embeddings']
|
|
1157
1181
|
: modality === 'vlm' ? ['chat', 'stream', 'vision', 'functions']
|
|
1182
|
+
: modality === 'audio' ? (inferred.capabilities?.length ? inferred.capabilities : ['tts'])
|
|
1158
1183
|
: ['chat', 'stream', 'functions'];
|
|
1159
1184
|
const rawCaps = Array.isArray(capabilities) && capabilities.length ? capabilities : defaultCaps;
|
|
1160
1185
|
const resolvedCaps = [...new Set([
|
|
@@ -1778,14 +1803,16 @@ export async function startHuggingFaceDownload({
|
|
|
1778
1803
|
else if (
|
|
1779
1804
|
fetchImpl === globalThis.fetch
|
|
1780
1805
|
&& process.env.WORK_DISABLE_AUTO_PYTHON !== '1'
|
|
1781
|
-
&& job.files.some(f => /\.(safetensors|onnx)$/i.test(String(f?.name || '')))
|
|
1806
|
+
&& job.files.some(f => /\.(safetensors|onnx|bin|pt|pth)$/i.test(String(f?.name || '')))
|
|
1782
1807
|
) {
|
|
1783
1808
|
job.currentFile = 'Подготовка среды Python и библиотек…';
|
|
1784
1809
|
try {
|
|
1785
1810
|
const capsLow = (Array.isArray(job.capabilities) ? job.capabilities : []).map(c => String(c).toLowerCase());
|
|
1786
1811
|
const depMod = capsLow.includes('rerank') || /rerank/i.test(cleanId) ? 'rerank'
|
|
1812
|
+
: capsLow.includes('music') ? 'music'
|
|
1787
1813
|
: capsLow.includes('tts') ? 'tts'
|
|
1788
1814
|
: (capsLow.includes('stt') || capsLow.includes('asr')) ? 'stt'
|
|
1815
|
+
: (capsLow.includes('video') || job.modality === 'video') ? 'video'
|
|
1789
1816
|
: capsLow.includes('image') ? 'image'
|
|
1790
1817
|
: (capsLow.includes('embeddings') || job.modality === 'embed') ? 'embed'
|
|
1791
1818
|
: 'llm';
|
|
@@ -2278,7 +2305,8 @@ export function detectBrokenWeightsLayout(weightsDir) {
|
|
|
2278
2305
|
if (hasShards && !files.some(f => /\.safetensors\.index\.json$/i.test(f)))
|
|
2279
2306
|
reasons.push('есть шарды весов, но нет индекса *.safetensors.index.json');
|
|
2280
2307
|
const onnxFiles = files.filter(f => /\.onnx$/i.test(f));
|
|
2281
|
-
|
|
2308
|
+
const hasPiperConfig = onnxFiles.some(rel => hasRel(`${rel}.json`));
|
|
2309
|
+
if (onnxFiles.length && !hasPiperConfig && !files.some(f => /\.onnx_data$/i.test(f))) {
|
|
2282
2310
|
let graphSmall = false;
|
|
2283
2311
|
for (const rel of onnxFiles) {
|
|
2284
2312
|
try {
|