@mlx-node/vlm 0.0.7 → 0.0.8
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/README.md +0 -1
- package/dist/index.d.ts +0 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -5
- package/dist/models/qianfan-ocr.d.ts +26 -19
- package/dist/models/qianfan-ocr.d.ts.map +1 -1
- package/dist/models/qianfan-ocr.js +18 -43
- package/dist/pipeline/structure-v3.d.ts.map +1 -1
- package/package.json +4 -4
- package/dist/models/index.d.ts +0 -5
- package/dist/models/index.d.ts.map +0 -1
- package/dist/models/index.js +0 -4
- package/dist/models/paddleocr-vl-configs.d.ts +0 -53
- package/dist/models/paddleocr-vl-configs.d.ts.map +0 -1
- package/dist/models/paddleocr-vl-configs.js +0 -53
package/README.md
CHANGED
|
@@ -290,7 +290,6 @@ const buffer = documentToXlsx(doc);
|
|
|
290
290
|
|
|
291
291
|
| Export | Description |
|
|
292
292
|
| --------------------------- | ------------------------------------------------ |
|
|
293
|
-
| `PADDLEOCR_VL_CONFIGS` | Pre-defined PaddleOCR-VL 1.5 config |
|
|
294
293
|
| `createPaddleocrVlConfig()` | Default config factory |
|
|
295
294
|
| `OutputFormat` | Enum: `Raw`, `Plain`, `Markdown`, `Html`, `Json` |
|
|
296
295
|
|
package/dist/index.d.ts
CHANGED
|
@@ -32,13 +32,10 @@ export { TextDetModel, type TextBox, TextRecModel, type RecResult } from '@mlx-n
|
|
|
32
32
|
export { DocOrientationModel, type OrientationResult, type ClassifyRotateResult, DocUnwarpModel, type UnwarpResult, } from '@mlx-node/core';
|
|
33
33
|
export { StructureV3Pipeline, type StructureV3Config, type AnalyzeOptions, type StructuredElement, type StructuredDocument, type TextLine, } from './pipeline/structure-v3.js';
|
|
34
34
|
export type { VisionConfig, TextConfig, ModelConfig, VlmChatConfig, VlmChatMessage, VlmBatchItem, } from '@mlx-node/core';
|
|
35
|
-
export { PADDLEOCR_VL_CONFIGS, type PaddleOCRVLConfig } from './models/paddleocr-vl-configs.js';
|
|
36
35
|
export { QianfanOCRModel } from './models/qianfan-ocr.js';
|
|
37
36
|
export { createQianfanOcrConfig } from '@mlx-node/core';
|
|
38
37
|
export type { QianfanOcrConfig, InternVisionConfig, Qwen3LmConfig } from '@mlx-node/core';
|
|
39
38
|
export { VlmChatResult, type VLMChatResult } from '@mlx-node/core';
|
|
40
39
|
export { parsePaddleResponse, parseVlmOutput, formatDocument, type ParsedDocument, type DocumentElement, type Table, type TableRow, type TableCell, type Paragraph, type ParserConfig, OutputFormat, } from '@mlx-node/core';
|
|
41
40
|
export { documentToXlsx, saveToXlsx } from '@mlx-node/core';
|
|
42
|
-
export { Qwen3Tokenizer as Tokenizer } from '@mlx-node/lm';
|
|
43
|
-
export { MxArray, type DType } from '@mlx-node/core';
|
|
44
41
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAKH,OAAO,EAAE,OAAO,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AAGlE,OAAO,EAAE,cAAc,EAAE,KAAK,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAGpE,OAAO,EAAE,YAAY,EAAE,KAAK,OAAO,EAAE,YAAY,EAAE,KAAK,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAG1F,OAAO,EACL,mBAAmB,EACnB,KAAK,iBAAiB,EACtB,KAAK,oBAAoB,EACzB,cAAc,EACd,KAAK,YAAY,GAClB,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EACL,mBAAmB,EACnB,KAAK,iBAAiB,EACtB,KAAK,cAAc,EACnB,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,KAAK,QAAQ,GACd,MAAM,4BAA4B,CAAC;AAGpC,YAA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AS,EACd,KAAK,SAAS,EACd,KAAK,YAAY,EACjB,YAAY,GACb,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -37,8 +37,6 @@ export { TextDetModel, TextRecModel } from '@mlx-node/core';
|
|
|
37
37
|
export { DocOrientationModel, DocUnwarpModel, } from '@mlx-node/core';
|
|
38
38
|
// Document understanding pipeline (PP-StructureV3)
|
|
39
39
|
export { StructureV3Pipeline, } from './pipeline/structure-v3.js';
|
|
40
|
-
// Model-specific configs
|
|
41
|
-
export { PADDLEOCR_VL_CONFIGS } from './models/paddleocr-vl-configs.js';
|
|
42
40
|
// Qianfan-OCR model (InternVL architecture)
|
|
43
41
|
export { QianfanOCRModel } from './models/qianfan-ocr.js';
|
|
44
42
|
export { createQianfanOcrConfig } from '@mlx-node/core';
|
|
@@ -48,6 +46,3 @@ export { VlmChatResult } from '@mlx-node/core';
|
|
|
48
46
|
export { parsePaddleResponse, parseVlmOutput, formatDocument, OutputFormat, } from '@mlx-node/core';
|
|
49
47
|
// XLSX export (Rust implementation)
|
|
50
48
|
export { documentToXlsx, saveToXlsx } from '@mlx-node/core';
|
|
51
|
-
// Re-export shared utilities
|
|
52
|
-
export { Qwen3Tokenizer as Tokenizer } from '@mlx-node/lm';
|
|
53
|
-
export { MxArray } from '@mlx-node/core';
|
|
@@ -1,27 +1,34 @@
|
|
|
1
1
|
import { QianfanOCRModel as QianfanOCRModelNative } from '@mlx-node/core';
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
declare const QianfanOCRModel_base: {
|
|
3
|
+
new (config: import("@mlx-node/core").QianfanOcrConfig): import("@mlx-node/lm").StreamingInstance<typeof QianfanOCRModelNative, {
|
|
4
|
+
readonly recordModelPath: false;
|
|
5
|
+
}>;
|
|
6
|
+
load(modelPath: string): Promise<import("@mlx-node/lm").StreamingInstance<typeof QianfanOCRModelNative, {
|
|
7
|
+
readonly recordModelPath: false;
|
|
8
|
+
}>>;
|
|
9
|
+
};
|
|
4
10
|
/**
|
|
5
11
|
* Qianfan-OCR Vision-Language Model wrapper.
|
|
6
12
|
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
13
|
+
* Built from the shared {@link makeStreamingModel} factory in
|
|
14
|
+
* `@mlx-node/lm` — the empty `extends` inherits the AsyncGenerator
|
|
15
|
+
* session-streaming overrides (`chatStreamSessionStart` /
|
|
16
|
+
* `chatStreamSessionContinue` / `chatStreamSessionContinueTool`) so the
|
|
17
|
+
* wrapper structurally satisfies `SessionCapableModel` and can be
|
|
18
|
+
* passed to `ChatSession<QianfanOCRModel>`. Importing the factory from
|
|
19
|
+
* `@mlx-node/lm` is one-directional (vlm → lm), matching the existing
|
|
20
|
+
* `_runChatStream` dependency, so it introduces no circular dependency.
|
|
11
21
|
*
|
|
12
|
-
* Qianfan-OCR is a VLM (InternViT + Qwen3 language model). The
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
22
|
+
* Qianfan-OCR is a VLM (InternViT + Qwen3 language model). The continue
|
|
23
|
+
* path cannot splice new vision features into a live KV cache — image
|
|
24
|
+
* changes always require a fresh session start, which the high-level
|
|
25
|
+
* `ChatSession` wrapper handles via its `lastImagesKey` check.
|
|
26
|
+
*
|
|
27
|
+
* Unlike the LM families, Qianfan-OCR does NOT record its model path
|
|
28
|
+
* (`recordModelPath: false`) and therefore exposes no
|
|
29
|
+
* `applyChatTemplate` — preserving its historical surface.
|
|
17
30
|
*/
|
|
18
|
-
export declare class QianfanOCRModel extends
|
|
19
|
-
static load(modelPath: string): Promise<QianfanOCRModel>;
|
|
20
|
-
/** Streaming variant of {@link QianfanOCRModel#chatSessionStart}. */
|
|
21
|
-
chatStreamSessionStart(messages: ChatMessage[], config?: ChatConfig | null, signal?: AbortSignal): AsyncGenerator<ChatStreamEvent>;
|
|
22
|
-
/** Streaming variant of {@link QianfanOCRModel#chatSessionContinue}. */
|
|
23
|
-
chatStreamSessionContinue(userMessage: string, images: Uint8Array[] | null, config?: ChatConfig | null, signal?: AbortSignal): AsyncGenerator<ChatStreamEvent>;
|
|
24
|
-
/** Streaming variant of {@link QianfanOCRModel#chatSessionContinueTool}. */
|
|
25
|
-
chatStreamSessionContinueTool(toolCallId: string, content: string, config?: ChatConfig | null, signal?: AbortSignal): AsyncGenerator<ChatStreamEvent>;
|
|
31
|
+
export declare class QianfanOCRModel extends QianfanOCRModel_base {
|
|
26
32
|
}
|
|
33
|
+
export {};
|
|
27
34
|
//# sourceMappingURL=qianfan-ocr.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"qianfan-ocr.d.ts","sourceRoot":"","sources":["../../src/models/qianfan-ocr.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,IAAI,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"qianfan-ocr.d.ts","sourceRoot":"","sources":["../../src/models/qianfan-ocr.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,IAAI,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;;;;;;;;;AAI1E;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,qBAAa,eAAgB,SAAQ,oBAAqE;CAAG"}
|
|
@@ -1,52 +1,27 @@
|
|
|
1
1
|
import { QianfanOCRModel as QianfanOCRModelNative } from '@mlx-node/core';
|
|
2
|
-
import {
|
|
3
|
-
// Save references to the native callback-based session streaming methods
|
|
4
|
-
// before we override them. Captured at module load time so the subclass
|
|
5
|
-
// overrides can delegate without recursing into themselves. Each wrapper
|
|
6
|
-
// method below bridges the callback API to `AsyncGenerator<ChatStreamEvent>`
|
|
7
|
-
// so the wrapper structurally satisfies `SessionCapableModel` and can be
|
|
8
|
-
// passed to `ChatSession<QianfanOCRModel>` from `@mlx-node/lm`.
|
|
9
|
-
// oxlint-disable-next-line @typescript-eslint/unbound-method
|
|
10
|
-
const _nativeQianfanOcrChatStreamSessionStart = QianfanOCRModelNative.prototype.chatStreamSessionStart;
|
|
11
|
-
// oxlint-disable-next-line @typescript-eslint/unbound-method
|
|
12
|
-
const _nativeQianfanOcrChatStreamSessionContinue = QianfanOCRModelNative.prototype.chatStreamSessionContinue;
|
|
13
|
-
// oxlint-disable-next-line @typescript-eslint/unbound-method
|
|
14
|
-
const _nativeQianfanOcrChatStreamSessionContinueTool = QianfanOCRModelNative.prototype.chatStreamSessionContinueTool;
|
|
2
|
+
import { makeStreamingModel } from '@mlx-node/lm';
|
|
15
3
|
/**
|
|
16
4
|
* Qianfan-OCR Vision-Language Model wrapper.
|
|
17
5
|
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
6
|
+
* Built from the shared {@link makeStreamingModel} factory in
|
|
7
|
+
* `@mlx-node/lm` — the empty `extends` inherits the AsyncGenerator
|
|
8
|
+
* session-streaming overrides (`chatStreamSessionStart` /
|
|
9
|
+
* `chatStreamSessionContinue` / `chatStreamSessionContinueTool`) so the
|
|
10
|
+
* wrapper structurally satisfies `SessionCapableModel` and can be
|
|
11
|
+
* passed to `ChatSession<QianfanOCRModel>`. Importing the factory from
|
|
12
|
+
* `@mlx-node/lm` is one-directional (vlm → lm), matching the existing
|
|
13
|
+
* `_runChatStream` dependency, so it introduces no circular dependency.
|
|
22
14
|
*
|
|
23
|
-
* Qianfan-OCR is a VLM (InternViT + Qwen3 language model). The
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
15
|
+
* Qianfan-OCR is a VLM (InternViT + Qwen3 language model). The continue
|
|
16
|
+
* path cannot splice new vision features into a live KV cache — image
|
|
17
|
+
* changes always require a fresh session start, which the high-level
|
|
18
|
+
* `ChatSession` wrapper handles via its `lastImagesKey` check.
|
|
19
|
+
*
|
|
20
|
+
* Unlike the LM families, Qianfan-OCR does NOT record its model path
|
|
21
|
+
* (`recordModelPath: false`) and therefore exposes no
|
|
22
|
+
* `applyChatTemplate` — preserving its historical surface.
|
|
28
23
|
*/
|
|
29
|
-
export class QianfanOCRModel extends QianfanOCRModelNative {
|
|
30
|
-
static async load(modelPath) {
|
|
31
|
-
const instance = await QianfanOCRModelNative.load(modelPath);
|
|
32
|
-
Object.setPrototypeOf(instance, QianfanOCRModel.prototype);
|
|
33
|
-
return instance;
|
|
34
|
-
}
|
|
35
|
-
/** Streaming variant of {@link QianfanOCRModel#chatSessionStart}. */
|
|
36
|
-
// @ts-expect-error — override callback-based native method with AsyncGenerator
|
|
37
|
-
async *chatStreamSessionStart(messages, config, signal) {
|
|
38
|
-
yield* _runChatStream((callback) => _nativeQianfanOcrChatStreamSessionStart.call(this, messages, config ?? null, callback), signal);
|
|
39
|
-
}
|
|
40
|
-
/** Streaming variant of {@link QianfanOCRModel#chatSessionContinue}. */
|
|
41
|
-
// @ts-expect-error — override callback-based native method with AsyncGenerator
|
|
42
|
-
async *chatStreamSessionContinue(userMessage, images, config, signal) {
|
|
43
|
-
yield* _runChatStream((callback) => _nativeQianfanOcrChatStreamSessionContinue.call(this, userMessage, images, config ?? null, callback), signal);
|
|
44
|
-
}
|
|
45
|
-
/** Streaming variant of {@link QianfanOCRModel#chatSessionContinueTool}. */
|
|
46
|
-
// @ts-expect-error — override callback-based native method with AsyncGenerator
|
|
47
|
-
async *chatStreamSessionContinueTool(toolCallId, content, config, signal) {
|
|
48
|
-
yield* _runChatStream((callback) => _nativeQianfanOcrChatStreamSessionContinueTool.call(this, toolCallId, content, config ?? null, callback), signal);
|
|
49
|
-
}
|
|
24
|
+
export class QianfanOCRModel extends makeStreamingModel(QianfanOCRModelNative, { recordModelPath: false }) {
|
|
50
25
|
}
|
|
51
26
|
// -------------------------------------------------------------------
|
|
52
27
|
// Compile-time conformance check
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"structure-v3.d.ts","sourceRoot":"","sources":["../../src/pipeline/structure-v3.ts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|
|
2
2
|
"name": "@mlx-node/vlm",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.8",
|
|
4
4
|
"homepage": "https://github.com/mlx-node/mlx-node",
|
|
5
5
|
"bugs": {
|
|
6
6
|
"url": "https://github.com/mlx-node/mlx-node/issues"
|
|
@@ -28,9 +28,9 @@
|
|
|
28
28
|
"test": "vite test run"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@mlx-node/core": "0.0.
|
|
32
|
-
"@mlx-node/lm": "0.0.
|
|
33
|
-
"@napi-rs/image": "^1.
|
|
31
|
+
"@mlx-node/core": "0.0.8",
|
|
32
|
+
"@mlx-node/lm": "0.0.8",
|
|
33
|
+
"@napi-rs/image": "^1.13.0"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@types/node": "@types/node@24.12.2"
|
package/dist/models/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/models/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,oBAAoB,EAAE,KAAK,iBAAiB,EAAE,MAAM,2BAA2B,CAAC"}
|
package/dist/models/index.js
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* PaddleOCR-VL Model Configurations
|
|
3
|
-
*
|
|
4
|
-
* Based on the PaddleOCR-VL-1.5 model architecture.
|
|
5
|
-
*/
|
|
6
|
-
export interface VisionConfig {
|
|
7
|
-
modelType: 'paddleocr_vl';
|
|
8
|
-
hiddenSize: number;
|
|
9
|
-
intermediateSize: number;
|
|
10
|
-
numHiddenLayers: number;
|
|
11
|
-
numAttentionHeads: number;
|
|
12
|
-
numChannels: number;
|
|
13
|
-
imageSize: number;
|
|
14
|
-
patchSize: number;
|
|
15
|
-
hiddenAct: string;
|
|
16
|
-
layerNormEps: number;
|
|
17
|
-
attentionDropout: number;
|
|
18
|
-
spatialMergeSize: number;
|
|
19
|
-
}
|
|
20
|
-
export interface TextConfig {
|
|
21
|
-
modelType: 'paddleocr_vl';
|
|
22
|
-
hiddenSize: number;
|
|
23
|
-
numHiddenLayers: number;
|
|
24
|
-
intermediateSize: number;
|
|
25
|
-
numAttentionHeads: number;
|
|
26
|
-
rmsNormEps: number;
|
|
27
|
-
vocabSize: number;
|
|
28
|
-
numKeyValueHeads: number;
|
|
29
|
-
maxPositionEmbeddings: number;
|
|
30
|
-
ropeTheta: number;
|
|
31
|
-
ropeTraditional: boolean;
|
|
32
|
-
useBias: boolean;
|
|
33
|
-
headDim: number;
|
|
34
|
-
mropeSection: [number, number, number];
|
|
35
|
-
}
|
|
36
|
-
export interface PaddleOCRVLConfig {
|
|
37
|
-
visionConfig: VisionConfig;
|
|
38
|
-
textConfig: TextConfig;
|
|
39
|
-
modelType: 'paddleocr_vl';
|
|
40
|
-
ignoreIndex: number;
|
|
41
|
-
imageTokenId: number;
|
|
42
|
-
videoTokenId: number;
|
|
43
|
-
visionStartTokenId: number;
|
|
44
|
-
visionEndTokenId: number;
|
|
45
|
-
eosTokenId: number;
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* Available PaddleOCR-VL configurations
|
|
49
|
-
*/
|
|
50
|
-
export declare const PADDLEOCR_VL_CONFIGS: {
|
|
51
|
-
readonly 'paddleocr-vl-1.5': PaddleOCRVLConfig;
|
|
52
|
-
};
|
|
53
|
-
//# sourceMappingURL=paddleocr-vl-configs.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"paddleocr-vl-configs.d.ts","sourceRoot":"","sources":["../../src/models/paddleocr-vl-configs.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,WAAW,YAAY;IAC3B,SAAS,EAAE,cAAc,CAAC;IAC1B,UAAU,EAAE,MAAM,CAAC;IACnB,gBAAgB,EAAE,MAAM,CAAC;IACzB,eAAe,EAAE,MAAM,CAAC;IACxB,iBAAiB,E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 model architecture.
|
|
5
|
-
*/
|
|
6
|
-
/**
|
|
7
|
-
* PaddleOCR-VL-1.5 default configuration
|
|
8
|
-
*/
|
|
9
|
-
const PADDLEOCR_VL_1_5_CONFIG = {
|
|
10
|
-
modelType: 'paddleocr_vl',
|
|
11
|
-
ignoreIndex: -100,
|
|
12
|
-
imageTokenId: 100295,
|
|
13
|
-
videoTokenId: 100296,
|
|
14
|
-
visionStartTokenId: 101305,
|
|
15
|
-
visionEndTokenId: 101306,
|
|
16
|
-
eosTokenId: 2,
|
|
17
|
-
visionConfig: {
|
|
18
|
-
modelType: 'paddleocr_vl',
|
|
19
|
-
hiddenSize: 1152,
|
|
20
|
-
intermediateSize: 4304,
|
|
21
|
-
numHiddenLayers: 27,
|
|
22
|
-
numAttentionHeads: 16,
|
|
23
|
-
numChannels: 3,
|
|
24
|
-
imageSize: 384,
|
|
25
|
-
patchSize: 14,
|
|
26
|
-
hiddenAct: 'gelu_pytorch_tanh',
|
|
27
|
-
layerNormEps: 1e-6,
|
|
28
|
-
attentionDropout: 0.0,
|
|
29
|
-
spatialMergeSize: 2,
|
|
30
|
-
},
|
|
31
|
-
textConfig: {
|
|
32
|
-
modelType: 'paddleocr_vl',
|
|
33
|
-
hiddenSize: 1024,
|
|
34
|
-
numHiddenLayers: 18,
|
|
35
|
-
intermediateSize: 3072,
|
|
36
|
-
numAttentionHeads: 16,
|
|
37
|
-
rmsNormEps: 1e-5,
|
|
38
|
-
vocabSize: 103424,
|
|
39
|
-
numKeyValueHeads: 2,
|
|
40
|
-
maxPositionEmbeddings: 131072,
|
|
41
|
-
ropeTheta: 500000.0,
|
|
42
|
-
ropeTraditional: false,
|
|
43
|
-
useBias: false,
|
|
44
|
-
headDim: 128,
|
|
45
|
-
mropeSection: [16, 24, 24],
|
|
46
|
-
},
|
|
47
|
-
};
|
|
48
|
-
/**
|
|
49
|
-
* Available PaddleOCR-VL configurations
|
|
50
|
-
*/
|
|
51
|
-
export const PADDLEOCR_VL_CONFIGS = {
|
|
52
|
-
'paddleocr-vl-1.5': PADDLEOCR_VL_1_5_CONFIG,
|
|
53
|
-
};
|