Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/sdk/commands/bundle/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export const BUILTIN_PLUGINS: Record<string, { exportName: string }> = {
"onnx-ocr": { exportName: "ocrPlugin" },
"sdcpp-generation": { exportName: "diffusionPlugin" },
"ggml-vla": { exportName: "vlaPlugin" },
"ggml-classification": { exportName: "classificationPlugin" },
};

export const BUILTIN_SUFFIXES = Object.keys(BUILTIN_PLUGINS);
Expand Down
2 changes: 1 addition & 1 deletion packages/sdk/e2e/metro.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const config = getDefaultConfig(__dirname);
config.resolver = config.resolver || {};


const extraAssetExts = ['ogg', 'wma', 'aac', 'm4a', 'wav', 'mp3', 'txt', 'jsonl'];
const extraAssetExts = ['ogg', 'wma', 'aac', 'm4a', 'wav', 'mp3', 'txt', 'jsonl', 'gguf'];
config.resolver.assetExts = Array.from(
new Set([...(config.resolver.assetExts || []), ...extraAssetExts])
);
Expand Down
14 changes: 13 additions & 1 deletion packages/sdk/e2e/tests/mobile/consumer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,22 @@ resources.define("ocr", {
config: { langList: ["en"] },
});

async function resolveClassificationWeightsPath() {
// @ts-ignore - Metro turns the bundled GGUF file into an asset module.
// This path is relative to dist/tests/mobile/consumer.js after tsc.
const assetModule = require("../../../node_modules/@qvac/classification-ggml/weights/mobilenetv3_3class_v3_fp16.gguf");
return await resolveBundledAssetUri(assetModule);
}

// Classification ships bundled weights inside @qvac/classification-ggml,
// so no registry constant / pre-download is required.
// so no registry constant / pre-download is required. On mobile the weight
// file must still be resolved as a Metro asset and passed explicitly because
// the Bare worker bundle does not expose package data files at __dirname.
resources.define("classification", {
type: "classification",
config: async () => ({
modelPath: await resolveClassificationWeightsPath(),
}),
});

resources.define("sharded-embeddings", {
Expand Down
4 changes: 4 additions & 0 deletions packages/sdk/e2e/tests/test-definitions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { kvCacheTests } from "./kv-cache-tests.js";
import { errorTests } from "./error-tests.js";
import { toolsTests } from "./tools-tests.js";
import { ocrTests } from "./ocr-tests.js";
import { classificationTests } from "./classification-tests.js";
import { ttsTests } from "./tts-tests.js";
import { configReloadTests } from "./config-reload-tests.js";
import { loggingTests } from "./logging-tests.js";
Expand Down Expand Up @@ -252,6 +253,9 @@ export const tests = [
// OCR tests
...ocrTests,

// Classification tests
...classificationTests,

// TTS tests
...ttsTests,

Expand Down
Loading