@blank-utils/llm 0.4.19 → 0.4.20
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.
|
@@ -1461,7 +1461,7 @@ ${systemPrompt}` : systemPrompt;
|
|
|
1461
1461
|
const { pipeline: pipeline2, env } = await import("@huggingface/transformers");
|
|
1462
1462
|
env.allowLocalModels = false;
|
|
1463
1463
|
env.useBrowserCache = true;
|
|
1464
|
-
const captioner = await pipeline2("image-to-text", "
|
|
1464
|
+
const captioner = await pipeline2("image-to-text", "Xenova/vit-gpt2-image-captioning", { device: "wasm", dtype: "q8" });
|
|
1465
1465
|
for (let i = 0; i < needsCaptioning.length; i++) {
|
|
1466
1466
|
if (abortRef.current) break;
|
|
1467
1467
|
const img = needsCaptioning[i];
|
|
@@ -1469,9 +1469,9 @@ ${systemPrompt}` : systemPrompt;
|
|
|
1469
1469
|
setStreamingText(`[System: Extracting detailed visual description for ${img.name}... ${i + 1}/${needsCaptioning.length}]
|
|
1470
1470
|
`);
|
|
1471
1471
|
const out = await captioner(img.dataUrl, {
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1472
|
+
max_new_tokens: 64,
|
|
1473
|
+
num_beams: 4,
|
|
1474
|
+
repetition_penalty: 1.5
|
|
1475
1475
|
});
|
|
1476
1476
|
let val = "";
|
|
1477
1477
|
if (Array.isArray(out) && out[0] && out[0].generated_text) val = out[0].generated_text;
|
package/dist/index.js
CHANGED
package/dist/react/index.js
CHANGED
package/package.json
CHANGED