@mlx-node/vlm 0.0.8 → 0.0.10

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.
@@ -1,10 +1,18 @@
1
1
  import { QianfanOCRModel as QianfanOCRModelNative } from '@mlx-node/core';
2
2
  declare const QianfanOCRModel_base: {
3
3
  new (config: import("@mlx-node/core").QianfanOcrConfig): import("@mlx-node/lm").StreamingInstance<typeof QianfanOCRModelNative, {
4
- readonly recordModelPath: false;
4
+ readonly recordModelPath: true;
5
+ readonly templateContentPolicy: {
6
+ readonly order: "imagesThenText";
7
+ readonly existingImagePlaceholder: "<image>";
8
+ };
5
9
  }>;
6
10
  load(modelPath: string): Promise<import("@mlx-node/lm").StreamingInstance<typeof QianfanOCRModelNative, {
7
- readonly recordModelPath: false;
11
+ readonly recordModelPath: true;
12
+ readonly templateContentPolicy: {
13
+ readonly order: "imagesThenText";
14
+ readonly existingImagePlaceholder: "<image>";
15
+ };
8
16
  }>>;
9
17
  };
10
18
  /**
@@ -24,9 +32,8 @@ declare const QianfanOCRModel_base: {
24
32
  * changes always require a fresh session start, which the high-level
25
33
  * `ChatSession` wrapper handles via its `lastImagesKey` check.
26
34
  *
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.
35
+ * Qianfan-OCR records its model path so `applyChatTemplate` uses the exact
36
+ * tokenizer/template asset required by native inference and token counting.
30
37
  */
31
38
  export declare class QianfanOCRModel extends QianfanOCRModel_base {
32
39
  }
@@ -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;;;;;;;;;AAI1E;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,qBAAa,eAAgB,SAAQ,oBAAqE;CAAG"}
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;;;;;;;;;;;;;;;;;;;GAmBG;AACH,qBAAa,eAAgB,SAAQ,oBAMnC;CAAG"}
@@ -17,11 +17,16 @@ import { makeStreamingModel } from '@mlx-node/lm';
17
17
  * changes always require a fresh session start, which the high-level
18
18
  * `ChatSession` wrapper handles via its `lastImagesKey` check.
19
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.
20
+ * Qianfan-OCR records its model path so `applyChatTemplate` uses the exact
21
+ * tokenizer/template asset required by native inference and token counting.
23
22
  */
24
- export class QianfanOCRModel extends makeStreamingModel(QianfanOCRModelNative, { recordModelPath: false }) {
23
+ export class QianfanOCRModel extends makeStreamingModel(QianfanOCRModelNative, {
24
+ recordModelPath: true,
25
+ templateContentPolicy: {
26
+ order: 'imagesThenText',
27
+ existingImagePlaceholder: '<image>',
28
+ },
29
+ }) {
25
30
  }
26
31
  // -------------------------------------------------------------------
27
32
  // Compile-time conformance check
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mlx-node/vlm",
3
- "version": "0.0.8",
3
+ "version": "0.0.10",
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,8 +28,8 @@
28
28
  "test": "vite test run"
29
29
  },
30
30
  "dependencies": {
31
- "@mlx-node/core": "0.0.8",
32
- "@mlx-node/lm": "0.0.8",
31
+ "@mlx-node/core": "0.0.10",
32
+ "@mlx-node/lm": "0.0.10",
33
33
  "@napi-rs/image": "^1.13.0"
34
34
  },
35
35
  "devDependencies": {