omni-viewer-core 0.14.0 → 0.15.0
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 +8 -3
- package/dist/i18n/catalog.en.js +8 -3
- package/dist/i18n/catalog.ja.js +8 -3
- package/dist/i18n/catalog.ko.js +8 -3
- package/dist/i18n/catalog.zh-cn.js +8 -3
- package/dist/parsers/gguf/index.d.ts +33 -25
- package/dist/parsers/gguf/index.js +484 -449
- package/dist/parsers/numpy/index.d.ts +38 -0
- package/dist/parsers/numpy/index.js +328 -0
- package/dist/parsers/tflite/index.d.ts +27 -7
- package/dist/parsers/tflite/index.js +374 -228
- package/dist/registry/index.d.ts +6 -1
- package/dist/registry/index.js +14 -1
- package/dist/styles/audio.css +5 -2
- package/dist/styles/numpy.css +2 -0
- package/dist/viewers/audio/index.d.ts +25 -1
- package/dist/viewers/audio/index.js +62 -4
- package/dist/viewers/audio/styles.js +5 -2
- package/dist/viewers/numpy/index.d.ts +22 -0
- package/dist/viewers/numpy/index.js +259 -0
- package/dist/viewers/numpy/styles.d.ts +1 -0
- package/dist/viewers/numpy/styles.js +3 -0
- package/dist/viewers/tflite/index.js +61 -20
- package/package.json +9 -1
package/README.md
CHANGED
|
@@ -15,7 +15,7 @@ models, viewers mount into a DOM element, and everything host-specific
|
|
|
15
15
|
- **Documents** — PDF, Word (DOCX and legacy DOC), HWP, PowerPoint (PPTX and
|
|
16
16
|
legacy PPT), Markdown, LaTeX (structure and math preview, not typesetting)
|
|
17
17
|
- **Data & spreadsheets** — Excel, CSV/TSV, JSON, JSONL/NDJSON, YAML, TOML,
|
|
18
|
-
Parquet, Avro, HDF5, MATLAB MAT, Safetensors, GGUF, ONNX, TFLite/LiteRT,
|
|
18
|
+
Parquet, Avro, HDF5, MATLAB MAT, NumPy (NPY/NPZ), Safetensors, GGUF, ONNX, TFLite/LiteRT,
|
|
19
19
|
Protocol Buffers, ReqIF, SQLite
|
|
20
20
|
- **Media & graphics** — audio (waveform/spectrogram), video, images,
|
|
21
21
|
Photoshop PSD
|
|
@@ -86,8 +86,13 @@ available, but it requires the host to load the complete file first.
|
|
|
86
86
|
|
|
87
87
|
### GGUF metadata and tensor index
|
|
88
88
|
|
|
89
|
-
GGUF parsing
|
|
90
|
-
large-array values into an Omni
|
|
89
|
+
GGUF parsing reads the header, metadata block, and tensor index directly from
|
|
90
|
+
ranged reads, and normalizes their bigint and large-array values into an Omni
|
|
91
|
+
Viewer JSON-safe document. Tensor payload bytes are never read, metadata array
|
|
92
|
+
bodies are skipped rather than decoded, and only a bounded number of metadata
|
|
93
|
+
and tensor entries is retained, so a model's vocabulary size does not affect
|
|
94
|
+
peak memory or what the document contains. `normalizeGguf` remains available for
|
|
95
|
+
hosts that already hold a `@huggingface/gguf` parse result. Node hosts can parse
|
|
91
96
|
a local model without loading tensor payloads and mount the result separately:
|
|
92
97
|
|
|
93
98
|
```ts
|
package/dist/i18n/catalog.en.js
CHANGED
|
@@ -68,6 +68,10 @@ export const CATALOG_EN = {
|
|
|
68
68
|
'safetensors.structure': 'Structure', 'safetensors.noData': 'No data available.',
|
|
69
69
|
'safetensors.matchingRows': '{count} matching rows',
|
|
70
70
|
'safetensors.matchingRowsLimited': '{visible} / {total} matching rows shown',
|
|
71
|
+
'numpy.title': 'NumPy arrays', 'numpy.selectArray': 'Select array', 'numpy.data': 'Data',
|
|
72
|
+
'numpy.arrays': 'Arrays', 'numpy.copyJson': 'Copy JSON', 'numpy.noData': 'No arrays available.',
|
|
73
|
+
'numpy.previewUnavailable': 'A value preview is not available for this dtype.', 'numpy.slice': 'Slice',
|
|
74
|
+
'numpy.gridShown': '{rows} / {totalRows} rows · {columns} / {totalColumns} columns shown',
|
|
71
75
|
'gguf.title': 'GGUF', 'gguf.search': 'Search metadata and tensors…', 'gguf.copyJson': 'Copy JSON',
|
|
72
76
|
'gguf.structure': 'Structure', 'gguf.noData': 'No data available.',
|
|
73
77
|
'gguf.matchingRows': '{count} matching rows',
|
|
@@ -85,7 +89,6 @@ export const CATALOG_EN = {
|
|
|
85
89
|
'gguf.warning.tensorsLimited': 'Showing the first {shown} of {total} tensors to limit memory use.',
|
|
86
90
|
'gguf.warning.metadataLimited': 'Showing the first {shown} of {total} metadata entries to limit memory use.',
|
|
87
91
|
'gguf.warning.textTruncated': 'Some text was truncated by per-field limits or the normalized GGUF character budget.',
|
|
88
|
-
'gguf.warning.metadataTooLarge': 'This file’s metadata is too large to parse in full, so only key previews are shown and the tensor list is unavailable.',
|
|
89
92
|
'onnx.title': 'ONNX model', 'onnx.search': 'Search graph, nodes, and tensors…', 'onnx.copyJson': 'Copy JSON',
|
|
90
93
|
'onnx.graph': 'Graph', 'onnx.nodes': 'Nodes', 'onnx.tensors': 'Tensors', 'onnx.io': 'Inputs & Outputs',
|
|
91
94
|
'onnx.modelInfo': 'Model Info', 'onnx.rows': '{shown} / {total} rows shown', 'onnx.noMatches': 'No rows match the current search.',
|
|
@@ -138,6 +141,8 @@ export const CATALOG_EN = {
|
|
|
138
141
|
'tflite.warning.customOps': '{count} custom operator(s) require a matching runtime registration: {names}',
|
|
139
142
|
'tflite.warning.flexOps': '{count} operator(s) fall back to Select TensorFlow ops.',
|
|
140
143
|
'tflite.warning.appendedBuffers': '{count} buffer(s) store their payload outside the FlatBuffer.',
|
|
144
|
+
'tflite.warning.externalBuffers': '{count} constant buffer(s) live in a separate file that this viewer does not read.',
|
|
145
|
+
'tflite.warning.missingExternalBuffers': '{count} tensor(s) reference an external buffer the model does not declare.',
|
|
141
146
|
'tflite.column.index': '#', 'tflite.column.name': 'Name', 'tflite.column.operator': 'Operator',
|
|
142
147
|
'tflite.column.kind': 'Kind', 'tflite.column.version': 'Version', 'tflite.column.inputs': 'Inputs',
|
|
143
148
|
'tflite.column.outputs': 'Outputs', 'tflite.column.optionsType': 'Options type', 'tflite.column.options': 'Options',
|
|
@@ -147,7 +152,7 @@ export const CATALOG_EN = {
|
|
|
147
152
|
'tflite.column.signature': 'Signature', 'tflite.column.typeShape': 'Type / Shape',
|
|
148
153
|
'tflite.column.tensorIndex': 'Tensor', 'tflite.column.fileOffset': 'File offset',
|
|
149
154
|
'tflite.column.usedBy': 'Used by', 'tflite.column.buffer': 'Buffer',
|
|
150
|
-
'tflite.storage.empty': 'Runtime', 'tflite.storage.inline': 'Inline', 'tflite.storage.appended': 'Appended',
|
|
155
|
+
'tflite.storage.empty': 'Runtime', 'tflite.storage.inline': 'Inline', 'tflite.storage.appended': 'Appended', 'tflite.storage.external': 'External file',
|
|
151
156
|
'tflite.kind.builtin': 'Builtin', 'tflite.kind.custom': 'Custom', 'tflite.kind.input': 'Input',
|
|
152
157
|
'tflite.kind.output': 'Output', 'tflite.kind.signatureInput': 'Signature input',
|
|
153
158
|
'tflite.kind.signatureOutput': 'Signature output',
|
|
@@ -157,7 +162,7 @@ export const CATALOG_EN = {
|
|
|
157
162
|
'tflite.info.subgraphs': 'Subgraphs', 'tflite.info.signatures': 'Signatures',
|
|
158
163
|
'tflite.info.operatorCode': 'Operator code', 'tflite.info.metadata': 'Metadata',
|
|
159
164
|
'tflite.info.expectedSize': 'Expected size', 'tflite.info.shapeSignature': 'Shape signature',
|
|
160
|
-
'tflite.info.sparsity': 'Sparsity', 'tflite.info.traversalOrder': 'Traversal order',
|
|
165
|
+
'tflite.info.sparsity': 'Sparsity', 'tflite.info.traversalOrder': 'Traversal order', 'tflite.info.blockMap': 'Block map',
|
|
161
166
|
'tflite.inspector.inputs': 'Inputs', 'tflite.inspector.outputs': 'Outputs',
|
|
162
167
|
'tflite.inspector.intermediates': 'Intermediates', 'tflite.inspector.options': 'Options',
|
|
163
168
|
'tflite.inspector.customOptions': 'Custom options', 'tflite.inspector.subgraphs': 'Referenced subgraphs',
|
package/dist/i18n/catalog.ja.js
CHANGED
|
@@ -64,6 +64,10 @@ export const CATALOG_JA = {
|
|
|
64
64
|
'safetensors.structure': '構造', 'safetensors.noData': '表示できるデータがありません。',
|
|
65
65
|
'safetensors.matchingRows': '一致する行: {count}件',
|
|
66
66
|
'safetensors.matchingRowsLimited': '一致する{total}行中{visible}行を表示',
|
|
67
|
+
'numpy.title': 'NumPy配列', 'numpy.selectArray': '配列を選択', 'numpy.data': 'データ',
|
|
68
|
+
'numpy.arrays': '配列一覧', 'numpy.copyJson': 'JSONをコピー', 'numpy.noData': '表示できる配列がありません。',
|
|
69
|
+
'numpy.previewUnavailable': 'このデータ型の値プレビューは利用できません。', 'numpy.slice': 'スライス',
|
|
70
|
+
'numpy.gridShown': '{totalRows}行中{rows}行・{totalColumns}列中{columns}列を表示',
|
|
67
71
|
'gguf.title': 'GGUF', 'gguf.search': 'メタデータとテンソルを検索…', 'gguf.copyJson': 'JSONをコピー',
|
|
68
72
|
'gguf.structure': '構造', 'gguf.noData': '表示できるデータがありません。',
|
|
69
73
|
'gguf.matchingRows': '一致する行: {count}件',
|
|
@@ -81,7 +85,6 @@ export const CATALOG_JA = {
|
|
|
81
85
|
'gguf.warning.tensorsLimited': 'メモリ使用量を抑えるため、{total}個のテンソルのうち先頭{shown}個を表示します。',
|
|
82
86
|
'gguf.warning.metadataLimited': 'メモリ使用量を抑えるため、{total}個のメタデータのうち先頭{shown}個を表示します。',
|
|
83
87
|
'gguf.warning.textTruncated': 'フィールド制限またはGGUF文字数予算により、一部のテキストが省略されました。',
|
|
84
|
-
'gguf.warning.metadataTooLarge': 'このファイルのメタデータは大きすぎて完全には解析できません。キーのプレビューのみを表示し、テンソル一覧は利用できません。',
|
|
85
88
|
'onnx.title': 'ONNXモデル', 'onnx.search': 'グラフ、ノード、テンソルを検索…', 'onnx.copyJson': 'JSONをコピー',
|
|
86
89
|
'onnx.graph': 'グラフ', 'onnx.nodes': 'ノード', 'onnx.tensors': 'テンソル', 'onnx.io': '入出力',
|
|
87
90
|
'onnx.modelInfo': 'モデル情報', 'onnx.rows': '{total}行中{shown}行を表示', 'onnx.noMatches': '検索に一致する行がありません。',
|
|
@@ -134,6 +137,8 @@ export const CATALOG_JA = {
|
|
|
134
137
|
'tflite.warning.customOps': 'カスタム演算子{count}件にはランタイムへの登録が必要です: {names}',
|
|
135
138
|
'tflite.warning.flexOps': '{count}件の演算子がSelect TensorFlow演算にフォールバックします。',
|
|
136
139
|
'tflite.warning.appendedBuffers': '{count}件のバッファがFlatBufferの外部にデータを保持しています。',
|
|
140
|
+
'tflite.warning.externalBuffers': '{count}件の定数バッファはこのビューアが読まない別ファイルにあります。',
|
|
141
|
+
'tflite.warning.missingExternalBuffers': '{count}件のテンソルがモデルに宣言されていない外部バッファを参照しています。',
|
|
137
142
|
'tflite.column.index': '#', 'tflite.column.name': '名前', 'tflite.column.operator': '演算子',
|
|
138
143
|
'tflite.column.kind': '種類', 'tflite.column.version': 'バージョン', 'tflite.column.inputs': '入力',
|
|
139
144
|
'tflite.column.outputs': '出力', 'tflite.column.optionsType': 'オプション型', 'tflite.column.options': 'オプション',
|
|
@@ -143,7 +148,7 @@ export const CATALOG_JA = {
|
|
|
143
148
|
'tflite.column.signature': 'シグネチャ', 'tflite.column.typeShape': '型 / 形状',
|
|
144
149
|
'tflite.column.tensorIndex': 'テンソル', 'tflite.column.fileOffset': 'ファイルオフセット',
|
|
145
150
|
'tflite.column.usedBy': '使用元', 'tflite.column.buffer': 'バッファ',
|
|
146
|
-
'tflite.storage.empty': 'ランタイム', 'tflite.storage.inline': 'インライン', 'tflite.storage.appended': '外部追加',
|
|
151
|
+
'tflite.storage.empty': 'ランタイム', 'tflite.storage.inline': 'インライン', 'tflite.storage.appended': '外部追加', 'tflite.storage.external': '外部ファイル',
|
|
147
152
|
'tflite.kind.builtin': '組み込み', 'tflite.kind.custom': 'カスタム', 'tflite.kind.input': '入力',
|
|
148
153
|
'tflite.kind.output': '出力', 'tflite.kind.signatureInput': 'シグネチャ入力',
|
|
149
154
|
'tflite.kind.signatureOutput': 'シグネチャ出力',
|
|
@@ -153,7 +158,7 @@ export const CATALOG_JA = {
|
|
|
153
158
|
'tflite.info.subgraphs': 'サブグラフ', 'tflite.info.signatures': 'シグネチャ',
|
|
154
159
|
'tflite.info.operatorCode': '演算子コード', 'tflite.info.metadata': 'メタデータ',
|
|
155
160
|
'tflite.info.expectedSize': '想定サイズ', 'tflite.info.shapeSignature': '形状シグネチャ',
|
|
156
|
-
'tflite.info.sparsity': 'スパース性', 'tflite.info.traversalOrder': '走査順序',
|
|
161
|
+
'tflite.info.sparsity': 'スパース性', 'tflite.info.traversalOrder': '走査順序', 'tflite.info.blockMap': 'ブロックマップ',
|
|
157
162
|
'tflite.inspector.inputs': '入力', 'tflite.inspector.outputs': '出力',
|
|
158
163
|
'tflite.inspector.intermediates': '中間テンソル', 'tflite.inspector.options': 'オプション',
|
|
159
164
|
'tflite.inspector.customOptions': 'カスタムオプション', 'tflite.inspector.subgraphs': '参照サブグラフ',
|
package/dist/i18n/catalog.ko.js
CHANGED
|
@@ -66,6 +66,10 @@ export const CATALOG_KO = {
|
|
|
66
66
|
'safetensors.structure': '구조', 'safetensors.noData': '표시할 데이터가 없습니다.',
|
|
67
67
|
'safetensors.matchingRows': '일치하는 행 {count}개',
|
|
68
68
|
'safetensors.matchingRowsLimited': '전체 {total}행 중 일치하는 {visible}행 표시',
|
|
69
|
+
'numpy.title': 'NumPy 배열', 'numpy.selectArray': '배열 선택', 'numpy.data': '데이터',
|
|
70
|
+
'numpy.arrays': '배열 목록', 'numpy.copyJson': 'JSON 복사', 'numpy.noData': '표시할 배열이 없습니다.',
|
|
71
|
+
'numpy.previewUnavailable': '이 데이터 타입은 값 미리보기를 제공하지 않습니다.', 'numpy.slice': '슬라이스',
|
|
72
|
+
'numpy.gridShown': '전체 {totalRows}행 중 {rows}행 · 전체 {totalColumns}열 중 {columns}열 표시',
|
|
69
73
|
'gguf.title': 'GGUF', 'gguf.search': '메타데이터와 텐서 검색…', 'gguf.copyJson': 'JSON 복사',
|
|
70
74
|
'gguf.structure': '구조', 'gguf.noData': '표시할 데이터가 없습니다.',
|
|
71
75
|
'gguf.matchingRows': '일치하는 행 {count}개',
|
|
@@ -83,7 +87,6 @@ export const CATALOG_KO = {
|
|
|
83
87
|
'gguf.warning.tensorsLimited': '메모리 사용을 제한하기 위해 전체 {total}개 텐서 중 처음 {shown}개를 표시합니다.',
|
|
84
88
|
'gguf.warning.metadataLimited': '메모리 사용을 제한하기 위해 전체 {total}개 메타데이터 중 처음 {shown}개를 표시합니다.',
|
|
85
89
|
'gguf.warning.textTruncated': '필드별 제한 또는 GGUF 문자 예산으로 인해 일부 텍스트가 잘렸습니다.',
|
|
86
|
-
'gguf.warning.metadataTooLarge': '이 파일의 메타데이터가 너무 커서 전체를 해석할 수 없습니다. 키 미리보기만 표시되며 텐서 목록은 제공되지 않습니다.',
|
|
87
90
|
'onnx.title': 'ONNX 모델', 'onnx.search': '그래프, 노드, 텐서 검색…', 'onnx.copyJson': 'JSON 복사',
|
|
88
91
|
'onnx.graph': '그래프', 'onnx.nodes': '노드', 'onnx.tensors': '텐서', 'onnx.io': '입출력',
|
|
89
92
|
'onnx.modelInfo': '모델 정보', 'onnx.rows': '전체 {total}행 중 {shown}행 표시', 'onnx.noMatches': '검색과 일치하는 행이 없습니다.',
|
|
@@ -136,6 +139,8 @@ export const CATALOG_KO = {
|
|
|
136
139
|
'tflite.warning.customOps': '커스텀 연산자 {count}개는 런타임에 별도 등록이 필요합니다: {names}',
|
|
137
140
|
'tflite.warning.flexOps': '연산자 {count}개가 Select TensorFlow 연산으로 대체됩니다.',
|
|
138
141
|
'tflite.warning.appendedBuffers': '버퍼 {count}개가 FlatBuffer 바깥에 데이터를 저장합니다.',
|
|
142
|
+
'tflite.warning.externalBuffers': '상수 버퍼 {count}개가 이 뷰어가 읽지 않는 별도 파일에 있습니다.',
|
|
143
|
+
'tflite.warning.missingExternalBuffers': '텐서 {count}개가 모델에 선언되지 않은 외부 버퍼를 참조합니다.',
|
|
139
144
|
'tflite.column.index': '#', 'tflite.column.name': '이름', 'tflite.column.operator': '연산자',
|
|
140
145
|
'tflite.column.kind': '종류', 'tflite.column.version': '버전', 'tflite.column.inputs': '입력',
|
|
141
146
|
'tflite.column.outputs': '출력', 'tflite.column.optionsType': '옵션 형식', 'tflite.column.options': '옵션',
|
|
@@ -145,7 +150,7 @@ export const CATALOG_KO = {
|
|
|
145
150
|
'tflite.column.signature': '시그니처', 'tflite.column.typeShape': '타입 / 형상',
|
|
146
151
|
'tflite.column.tensorIndex': '텐서', 'tflite.column.fileOffset': '파일 오프셋',
|
|
147
152
|
'tflite.column.usedBy': '사용처', 'tflite.column.buffer': '버퍼',
|
|
148
|
-
'tflite.storage.empty': '런타임', 'tflite.storage.inline': '인라인', 'tflite.storage.appended': '외부 추가',
|
|
153
|
+
'tflite.storage.empty': '런타임', 'tflite.storage.inline': '인라인', 'tflite.storage.appended': '외부 추가', 'tflite.storage.external': '외부 파일',
|
|
149
154
|
'tflite.kind.builtin': '내장', 'tflite.kind.custom': '커스텀', 'tflite.kind.input': '입력',
|
|
150
155
|
'tflite.kind.output': '출력', 'tflite.kind.signatureInput': '시그니처 입력',
|
|
151
156
|
'tflite.kind.signatureOutput': '시그니처 출력',
|
|
@@ -155,7 +160,7 @@ export const CATALOG_KO = {
|
|
|
155
160
|
'tflite.info.subgraphs': '서브그래프', 'tflite.info.signatures': '시그니처',
|
|
156
161
|
'tflite.info.operatorCode': '연산자 코드', 'tflite.info.metadata': '메타데이터',
|
|
157
162
|
'tflite.info.expectedSize': '예상 크기', 'tflite.info.shapeSignature': '형상 시그니처',
|
|
158
|
-
'tflite.info.sparsity': '희소성', 'tflite.info.traversalOrder': '순회 순서',
|
|
163
|
+
'tflite.info.sparsity': '희소성', 'tflite.info.traversalOrder': '순회 순서', 'tflite.info.blockMap': '블록 맵',
|
|
159
164
|
'tflite.inspector.inputs': '입력', 'tflite.inspector.outputs': '출력',
|
|
160
165
|
'tflite.inspector.intermediates': '중간 텐서', 'tflite.inspector.options': '옵션',
|
|
161
166
|
'tflite.inspector.customOptions': '커스텀 옵션', 'tflite.inspector.subgraphs': '참조 서브그래프',
|
|
@@ -57,6 +57,10 @@ export const CATALOG_ZH_CN = {
|
|
|
57
57
|
'safetensors.title': 'Safetensors', 'safetensors.search': '搜索张量…', 'safetensors.copyJson': '复制 JSON',
|
|
58
58
|
'safetensors.structure': '结构', 'safetensors.noData': '没有可用数据。',
|
|
59
59
|
'safetensors.matchingRows': '{count} 个匹配行', 'safetensors.matchingRowsLimited': '显示 {visible} / {total} 个匹配行',
|
|
60
|
+
'numpy.title': 'NumPy 数组', 'numpy.selectArray': '选择数组', 'numpy.data': '数据',
|
|
61
|
+
'numpy.arrays': '数组列表', 'numpy.copyJson': '复制 JSON', 'numpy.noData': '没有可显示的数组。',
|
|
62
|
+
'numpy.previewUnavailable': '此数据类型无法预览值。', 'numpy.slice': '切片',
|
|
63
|
+
'numpy.gridShown': '显示 {rows} / {totalRows} 行 · {columns} / {totalColumns} 列',
|
|
60
64
|
'gguf.title': 'GGUF', 'gguf.search': '搜索元数据和张量…', 'gguf.copyJson': '复制 JSON',
|
|
61
65
|
'gguf.structure': '结构', 'gguf.noData': '没有可用数据。',
|
|
62
66
|
'gguf.matchingRows': '{count} 个匹配行', 'gguf.matchingRowsLimited': '显示 {visible} / {total} 个匹配行',
|
|
@@ -73,7 +77,6 @@ export const CATALOG_ZH_CN = {
|
|
|
73
77
|
'gguf.warning.tensorsLimited': '为限制内存使用,仅显示 {total} 个张量中的前 {shown} 个。',
|
|
74
78
|
'gguf.warning.metadataLimited': '为限制内存使用,仅显示 {total} 个元数据条目中的前 {shown} 个。',
|
|
75
79
|
'gguf.warning.textTruncated': '由于字段限制或 GGUF 字符预算,部分文本已被截断。',
|
|
76
|
-
'gguf.warning.metadataTooLarge': '该文件的元数据过大,无法完整解析,因此仅显示键的预览,且无法提供张量列表。',
|
|
77
80
|
'onnx.title': 'ONNX 模型', 'onnx.search': '搜索图、节点和张量…', 'onnx.copyJson': '复制 JSON',
|
|
78
81
|
'onnx.graph': '计算图', 'onnx.nodes': '节点', 'onnx.tensors': '张量', 'onnx.io': '输入和输出',
|
|
79
82
|
'onnx.modelInfo': '模型信息', 'onnx.rows': '显示 {shown} / {total} 行', 'onnx.noMatches': '没有符合当前搜索的行。',
|
|
@@ -125,6 +128,8 @@ export const CATALOG_ZH_CN = {
|
|
|
125
128
|
'tflite.warning.customOps': '{count} 个自定义算子需要在运行时注册:{names}',
|
|
126
129
|
'tflite.warning.flexOps': '{count} 个算子回退到 Select TensorFlow 算子。',
|
|
127
130
|
'tflite.warning.appendedBuffers': '{count} 个缓冲区将数据存放在 FlatBuffer 之外。',
|
|
131
|
+
'tflite.warning.externalBuffers': '{count} 个常量缓冲区位于本查看器不读取的独立文件中。',
|
|
132
|
+
'tflite.warning.missingExternalBuffers': '{count} 个张量引用了模型未声明的外部缓冲区。',
|
|
128
133
|
'tflite.column.index': '#', 'tflite.column.name': '名称', 'tflite.column.operator': '算子',
|
|
129
134
|
'tflite.column.kind': '类别', 'tflite.column.version': '版本', 'tflite.column.inputs': '输入',
|
|
130
135
|
'tflite.column.outputs': '输出', 'tflite.column.optionsType': '选项类型', 'tflite.column.options': '选项',
|
|
@@ -134,7 +139,7 @@ export const CATALOG_ZH_CN = {
|
|
|
134
139
|
'tflite.column.signature': '签名', 'tflite.column.typeShape': '类型 / 形状',
|
|
135
140
|
'tflite.column.tensorIndex': '张量', 'tflite.column.fileOffset': '文件偏移',
|
|
136
141
|
'tflite.column.usedBy': '使用者', 'tflite.column.buffer': '缓冲区',
|
|
137
|
-
'tflite.storage.empty': '运行时', 'tflite.storage.inline': '内联', 'tflite.storage.appended': '外部追加',
|
|
142
|
+
'tflite.storage.empty': '运行时', 'tflite.storage.inline': '内联', 'tflite.storage.appended': '外部追加', 'tflite.storage.external': '外部文件',
|
|
138
143
|
'tflite.kind.builtin': '内置', 'tflite.kind.custom': '自定义', 'tflite.kind.input': '输入',
|
|
139
144
|
'tflite.kind.output': '输出', 'tflite.kind.signatureInput': '签名输入',
|
|
140
145
|
'tflite.kind.signatureOutput': '签名输出',
|
|
@@ -144,7 +149,7 @@ export const CATALOG_ZH_CN = {
|
|
|
144
149
|
'tflite.info.subgraphs': '子图', 'tflite.info.signatures': '签名',
|
|
145
150
|
'tflite.info.operatorCode': '算子编码', 'tflite.info.metadata': '元数据',
|
|
146
151
|
'tflite.info.expectedSize': '预期大小', 'tflite.info.shapeSignature': '形状签名',
|
|
147
|
-
'tflite.info.sparsity': '稀疏性', 'tflite.info.traversalOrder': '遍历顺序',
|
|
152
|
+
'tflite.info.sparsity': '稀疏性', 'tflite.info.traversalOrder': '遍历顺序', 'tflite.info.blockMap': '块映射',
|
|
148
153
|
'tflite.inspector.inputs': '输入', 'tflite.inspector.outputs': '输出',
|
|
149
154
|
'tflite.inspector.intermediates': '中间张量', 'tflite.inspector.options': '选项',
|
|
150
155
|
'tflite.inspector.customOptions': '自定义选项', 'tflite.inspector.subgraphs': '引用的子图',
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Only the enum tables are imported. Reading the file is done here: see
|
|
3
|
+
* preflightGguf, which walks metadata *and* the tensor index from source bytes.
|
|
4
|
+
* These tables are the part of @huggingface/gguf worth depending on -- new ggml
|
|
5
|
+
* quantization types land there, and hand-maintaining them would drift.
|
|
6
|
+
*/
|
|
1
7
|
import { type GGUFParseOutput, type GGUFTypedMetadata } from '@huggingface/gguf';
|
|
2
8
|
export interface GgufSummaryItem {
|
|
3
9
|
labelKey: string;
|
|
@@ -70,44 +76,46 @@ export type HuggingFaceGgufOutput = GGUFParseOutput & {
|
|
|
70
76
|
typedMetadata: GGUFTypedMetadata;
|
|
71
77
|
};
|
|
72
78
|
/**
|
|
73
|
-
*
|
|
74
|
-
*
|
|
79
|
+
* Entries kept for display. The walk visits every metadata key and every tensor,
|
|
80
|
+
* but only this many are retained, so peak memory is independent of how many
|
|
81
|
+
* there are -- and the retained set is not multiplied across the document model,
|
|
75
82
|
* table rows, structure text, and clipboard JSON.
|
|
76
83
|
*/
|
|
77
84
|
export declare const GGUF_PREVIEW_ENTRY_LIMIT = 1000;
|
|
78
85
|
/** Total user-controlled characters copied into normalized display structures. */
|
|
79
86
|
export declare const GGUF_NORMALIZED_TEXT_BUDGET = 2000000;
|
|
80
|
-
/** Admission limits enforced from source bytes before @huggingface/gguf allocates entry objects. */
|
|
81
|
-
export declare const GGUF_PARSE_TENSOR_LIMIT = 100000;
|
|
82
|
-
export declare const GGUF_PARSE_METADATA_LIMIT = 10000;
|
|
83
|
-
/**
|
|
84
|
-
* Total metadata array elements. Numeric elements land in packed JS arrays (~8 B
|
|
85
|
-
* each), but INT64/UINT64 subtypes become BigInt objects, so keep the headroom
|
|
86
|
-
* modest: a 256K-vocab model's `tokens` + `token_type` + `merges` is ~1M elements,
|
|
87
|
-
* and the Qwen3 file from issue #18 measures 455,265.
|
|
88
|
-
*/
|
|
89
|
-
export declare const GGUF_PARSE_ARRAY_ELEMENT_LIMIT = 2000000;
|
|
90
|
-
export declare const GGUF_PARSE_STRING_BYTE_LIMIT: number;
|
|
91
87
|
/**
|
|
92
|
-
*
|
|
93
|
-
* *
|
|
94
|
-
*
|
|
88
|
+
* Structural admission limits, enforced from the source header before the walk
|
|
89
|
+
* starts. These bound how many *entries* a file may declare, which no amount of
|
|
90
|
+
* streaming can make free: each one still has to be visited.
|
|
95
91
|
*
|
|
96
|
-
*
|
|
97
|
-
*
|
|
98
|
-
*
|
|
99
|
-
*
|
|
92
|
+
* Note what is deliberately absent: there is no ceiling on metadata array
|
|
93
|
+
* elements. Array bodies are skipped rather than materialized, so vocabulary size
|
|
94
|
+
* no longer decides whether a document can be built -- the ceiling that rejected
|
|
95
|
+
* ordinary Qwen3 and Llama 3 files in
|
|
96
|
+
* https://github.com/battlecook/vscode-omni-viewer/issues/18 is gone rather than
|
|
97
|
+
* raised. What replaces it is exact instead of tuned: an array cannot declare more
|
|
98
|
+
* elements than the remaining file bytes can physically hold (see readGgufValue).
|
|
100
99
|
*/
|
|
101
|
-
export declare const
|
|
100
|
+
export declare const GGUF_PARSE_TENSOR_LIMIT = 100000;
|
|
101
|
+
export declare const GGUF_PARSE_METADATA_LIMIT = 10000;
|
|
102
|
+
/** Cumulative declared metadata string bytes; caps the text a document may draw from. */
|
|
103
|
+
export declare const GGUF_PARSE_STRING_BYTE_LIMIT: number;
|
|
102
104
|
/**
|
|
103
105
|
* Parses a remote GGUF URL. Node local files use the abortable `./node` helper.
|
|
104
|
-
* Tensor payload bytes are
|
|
105
|
-
*
|
|
106
|
+
* Tensor payload bytes are never read: only the metadata block and the tensor
|
|
107
|
+
* index that follows it are range-read, and array bodies within the metadata are
|
|
108
|
+
* skipped rather than decoded.
|
|
106
109
|
*/
|
|
107
110
|
export declare function parseGgufUri(uri: string, options?: GgufParseOptions): Promise<GgufDocument>;
|
|
108
|
-
/** Parses a complete in-memory input
|
|
111
|
+
/** Parses a complete in-memory input through the same range reader as a remote URL. */
|
|
109
112
|
export declare function parseGgufBytes(input: Uint8Array, options?: GgufBytesParseOptions): Promise<GgufDocument>;
|
|
110
|
-
/**
|
|
113
|
+
/**
|
|
114
|
+
* Converts @huggingface/gguf output to Omni Viewer's JSON-safe document model.
|
|
115
|
+
* Retained as a public adapter for hosts that call `gguf()` themselves; the
|
|
116
|
+
* viewer's own parse path builds the same document from source bytes and shares
|
|
117
|
+
* every accumulator and check below, so the two cannot drift apart.
|
|
118
|
+
*/
|
|
111
119
|
export declare function normalizeGguf(output: HuggingFaceGgufOutput, fileSize?: string, fileByteLength?: number | bigint, sourceHeader?: GgufHeaderInfo): GgufDocument;
|
|
112
120
|
/** Formats a byte count for display. Every GGUF entry point must use this one so
|
|
113
121
|
* the same file is not labelled "4.00 KB" locally and "4.00 KiB" in memory. */
|