@coreviz/sdk 1.1.4 → 1.1.6
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/dist/coreviz.d.ts +1 -1
- package/dist/coreviz.js +6 -5
- package/dist/resize.js +1 -1
- package/package.json +1 -1
package/dist/coreviz.d.ts
CHANGED
|
@@ -149,7 +149,7 @@ export interface CollectionsNamespace {
|
|
|
149
149
|
/**
|
|
150
150
|
* Create a new collection.
|
|
151
151
|
* @param name - Display name for the collection.
|
|
152
|
-
* @param icon - Optional
|
|
152
|
+
* @param icon - Optional lucide icon name.
|
|
153
153
|
* @param organizationId - Target organization. Defaults to the current user's organization.
|
|
154
154
|
*/
|
|
155
155
|
create(name: string, icon?: string, organizationId?: string): Promise<Collection>;
|
package/dist/coreviz.js
CHANGED
|
@@ -73,7 +73,8 @@ class CoreViz {
|
|
|
73
73
|
name,
|
|
74
74
|
...(icon ? { icon } : {}),
|
|
75
75
|
});
|
|
76
|
-
|
|
76
|
+
// API returns the collection directly (not wrapped in { dataset: ... })
|
|
77
|
+
return data.dataset ?? data;
|
|
77
78
|
},
|
|
78
79
|
update: async (collectionId, updates) => {
|
|
79
80
|
const data = await this._fetchMethod('PATCH', `/api/dataset/${collectionId}`, updates);
|
|
@@ -185,8 +186,8 @@ class CoreViz {
|
|
|
185
186
|
formData.append('path', options.path);
|
|
186
187
|
if (typeof file === 'string') {
|
|
187
188
|
// Node.js: treat as a file path — dynamic import fs to stay browser-compatible
|
|
188
|
-
const fs = await Promise.resolve().then(() => __importStar(require('fs')));
|
|
189
|
-
const path = await Promise.resolve().then(() => __importStar(require('path')));
|
|
189
|
+
const fs = await Promise.resolve().then(() => __importStar(require('node:fs')));
|
|
190
|
+
const path = await Promise.resolve().then(() => __importStar(require('node:path')));
|
|
190
191
|
const buffer = fs.readFileSync(file);
|
|
191
192
|
const ext = path.extname(file).slice(1).toLowerCase();
|
|
192
193
|
const mimeTypes = {
|
|
@@ -417,7 +418,7 @@ class CoreViz {
|
|
|
417
418
|
async tagLocal(imageInput, options) {
|
|
418
419
|
try {
|
|
419
420
|
// Dynamic import to avoid loading transformers if not used
|
|
420
|
-
const { AutoProcessor, AutoModelForImageTextToText, RawImage, env } = await Promise.resolve().then(() => __importStar(require('@huggingface/transformers')));
|
|
421
|
+
const { AutoProcessor, AutoModelForImageTextToText, RawImage, env } = await Promise.resolve().then(() => __importStar(require(/* webpackIgnore: true */ /* turbopackIgnore: true */ '@huggingface/transformers')));
|
|
421
422
|
// Configure transformers.js for browser usage
|
|
422
423
|
env.allowRemoteModels = true;
|
|
423
424
|
const processor = await AutoProcessor.from_pretrained('onnx-community/FastVLM-0.5B-ONNX');
|
|
@@ -556,7 +557,7 @@ Output:
|
|
|
556
557
|
async embedLocal(input, options) {
|
|
557
558
|
try {
|
|
558
559
|
// Dynamic import to avoid loading transformers if not used
|
|
559
|
-
const { AutoTokenizer, AutoProcessor, CLIPTextModelWithProjection, CLIPVisionModelWithProjection, RawImage } = await Promise.resolve().then(() => __importStar(require('@huggingface/transformers')));
|
|
560
|
+
const { AutoTokenizer, AutoProcessor, CLIPTextModelWithProjection, CLIPVisionModelWithProjection, RawImage } = await Promise.resolve().then(() => __importStar(require(/* webpackIgnore: true */ /* turbopackIgnore: true */ '@huggingface/transformers')));
|
|
560
561
|
const MODEL_ID = 'Xenova/clip-vit-large-patch14';
|
|
561
562
|
const start = Date.now();
|
|
562
563
|
// Load tokenizer and processor
|
package/dist/resize.js
CHANGED
|
@@ -113,7 +113,7 @@ async function serverResize(inputStr, maxWidth, maxHeight) {
|
|
|
113
113
|
try {
|
|
114
114
|
// Dynamic import to prevent bundling sharp on the client
|
|
115
115
|
// Note: `sharp` is an optional dependency (for RN/Expo compatibility). If missing, we gracefully fall back.
|
|
116
|
-
const sharpModule = await Promise.resolve().then(() => __importStar(require('sharp')));
|
|
116
|
+
const sharpModule = await Promise.resolve().then(() => __importStar(require(/* webpackIgnore: true */ /* turbopackIgnore: true */ 'sharp')));
|
|
117
117
|
const sharp = sharpModule.default;
|
|
118
118
|
let buffer;
|
|
119
119
|
let mimeType = 'image/jpeg';
|