@fgv/ts-extras-transformers 5.1.0-29

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.
Files changed (67) hide show
  1. package/.rush/temp/cad001c0dd0af20627d8849ed0e5fa4904160f67.tar.log +30 -0
  2. package/.rush/temp/chunked-rush-logs/ts-extras-transformers.build.chunks.jsonl +9 -0
  3. package/.rush/temp/chunked-rush-logs/ts-extras-transformers.test.chunks.jsonl +28 -0
  4. package/.rush/temp/operation/build/all.log +9 -0
  5. package/.rush/temp/operation/build/log-chunks.jsonl +9 -0
  6. package/.rush/temp/operation/build/state.json +3 -0
  7. package/.rush/temp/operation/test/all.log +28 -0
  8. package/.rush/temp/operation/test/log-chunks.jsonl +28 -0
  9. package/.rush/temp/operation/test/state.json +3 -0
  10. package/.rush/temp/shrinkwrap-deps.json +742 -0
  11. package/CHANGELOG.json +4 -0
  12. package/README.md +121 -0
  13. package/config/api-extractor.json +38 -0
  14. package/config/jest.config.json +13 -0
  15. package/config/rig.json +6 -0
  16. package/dist/index.js +137 -0
  17. package/dist/index.js.map +1 -0
  18. package/dist/test/unit/transformers.test.js +197 -0
  19. package/dist/test/unit/transformers.test.js.map +1 -0
  20. package/dist/ts-extras-transformers.d.ts +137 -0
  21. package/dist/tsdoc-metadata.json +11 -0
  22. package/eslint.config.js +15 -0
  23. package/etc/ts-extras-transformers.api.md +43 -0
  24. package/lib/index.d.ts +112 -0
  25. package/lib/index.d.ts.map +1 -0
  26. package/lib/index.js +143 -0
  27. package/lib/index.js.map +1 -0
  28. package/lib/test/unit/transformers.test.d.ts +2 -0
  29. package/lib/test/unit/transformers.test.d.ts.map +1 -0
  30. package/lib/test/unit/transformers.test.js +232 -0
  31. package/lib/test/unit/transformers.test.js.map +1 -0
  32. package/package.json +80 -0
  33. package/rush-logs/ts-extras-transformers.build.cache.log +3 -0
  34. package/rush-logs/ts-extras-transformers.build.log +9 -0
  35. package/rush-logs/ts-extras-transformers.test.cache.log +1 -0
  36. package/rush-logs/ts-extras-transformers.test.log +28 -0
  37. package/src/index.ts +179 -0
  38. package/src/test/unit/transformers.test.ts +267 -0
  39. package/temp/build/lint/_eslint-5eVG3S6w.json +14 -0
  40. package/temp/build/typescript/ts_8nwakTlr.json +1 -0
  41. package/temp/coverage/base.css +224 -0
  42. package/temp/coverage/block-navigation.js +87 -0
  43. package/temp/coverage/favicon.png +0 -0
  44. package/temp/coverage/index.html +116 -0
  45. package/temp/coverage/index.ts.html +622 -0
  46. package/temp/coverage/lcov-report/base.css +224 -0
  47. package/temp/coverage/lcov-report/block-navigation.js +87 -0
  48. package/temp/coverage/lcov-report/favicon.png +0 -0
  49. package/temp/coverage/lcov-report/index.html +116 -0
  50. package/temp/coverage/lcov-report/index.ts.html +622 -0
  51. package/temp/coverage/lcov-report/prettify.css +1 -0
  52. package/temp/coverage/lcov-report/prettify.js +2 -0
  53. package/temp/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  54. package/temp/coverage/lcov-report/sorter.js +210 -0
  55. package/temp/coverage/lcov.info +209 -0
  56. package/temp/coverage/prettify.css +1 -0
  57. package/temp/coverage/prettify.js +2 -0
  58. package/temp/coverage/sort-arrow-sprite.png +0 -0
  59. package/temp/coverage/sorter.js +210 -0
  60. package/temp/test/jest/haste-map-502913d9c10083bec2207119c45d7122-cd1aa4a0322f87b67f395127aa5e94ac-091f69b131db2c080ae4b15b7b2d4a16 +0 -0
  61. package/temp/test/jest/jest-transform-cache-502913d9c10083bec2207119c45d7122-79ef2876fae7ca75eedb2aa53dc48338/8d/package_8dec8c7ec8d6c787063a4a014e769a65 +53 -0
  62. package/temp/test/jest/jest-transform-cache-502913d9c10083bec2207119c45d7122-79ef2876fae7ca75eedb2aa53dc48338/d5/package_d56b0a8a49dbfccad646fc2e21950522 +203 -0
  63. package/temp/test/jest/jest-transform-cache-502913d9c10083bec2207119c45d7122-79ef2876fae7ca75eedb2aa53dc48338/fc/versions_fc561f31b0dfb504443c5b8531747bfb +31 -0
  64. package/temp/test/jest/perf-cache-502913d9c10083bec2207119c45d7122-da39a3ee5e6b4b0d3255bfef95601890 +1 -0
  65. package/temp/ts-extras-transformers.api.json +675 -0
  66. package/temp/ts-extras-transformers.api.md +43 -0
  67. package/tsconfig.json +8 -0
@@ -0,0 +1,675 @@
1
+ {
2
+ "metadata": {
3
+ "toolPackage": "@microsoft/api-extractor",
4
+ "toolVersion": "7.58.7",
5
+ "schemaVersion": 1011,
6
+ "oldestForwardsCompatibleVersion": 1001,
7
+ "tsdocConfig": {
8
+ "$schema": "https://developer.microsoft.com/json-schemas/tsdoc/v0/tsdoc.schema.json",
9
+ "noStandardTags": true,
10
+ "tagDefinitions": [
11
+ {
12
+ "tagName": "@alpha",
13
+ "syntaxKind": "modifier"
14
+ },
15
+ {
16
+ "tagName": "@beta",
17
+ "syntaxKind": "modifier"
18
+ },
19
+ {
20
+ "tagName": "@defaultValue",
21
+ "syntaxKind": "block"
22
+ },
23
+ {
24
+ "tagName": "@decorator",
25
+ "syntaxKind": "block",
26
+ "allowMultiple": true
27
+ },
28
+ {
29
+ "tagName": "@deprecated",
30
+ "syntaxKind": "block"
31
+ },
32
+ {
33
+ "tagName": "@eventProperty",
34
+ "syntaxKind": "modifier"
35
+ },
36
+ {
37
+ "tagName": "@example",
38
+ "syntaxKind": "block",
39
+ "allowMultiple": true
40
+ },
41
+ {
42
+ "tagName": "@experimental",
43
+ "syntaxKind": "modifier"
44
+ },
45
+ {
46
+ "tagName": "@inheritDoc",
47
+ "syntaxKind": "inline"
48
+ },
49
+ {
50
+ "tagName": "@internal",
51
+ "syntaxKind": "modifier"
52
+ },
53
+ {
54
+ "tagName": "@label",
55
+ "syntaxKind": "inline"
56
+ },
57
+ {
58
+ "tagName": "@link",
59
+ "syntaxKind": "inline",
60
+ "allowMultiple": true
61
+ },
62
+ {
63
+ "tagName": "@override",
64
+ "syntaxKind": "modifier"
65
+ },
66
+ {
67
+ "tagName": "@packageDocumentation",
68
+ "syntaxKind": "modifier"
69
+ },
70
+ {
71
+ "tagName": "@param",
72
+ "syntaxKind": "block",
73
+ "allowMultiple": true
74
+ },
75
+ {
76
+ "tagName": "@privateRemarks",
77
+ "syntaxKind": "block"
78
+ },
79
+ {
80
+ "tagName": "@public",
81
+ "syntaxKind": "modifier"
82
+ },
83
+ {
84
+ "tagName": "@readonly",
85
+ "syntaxKind": "modifier"
86
+ },
87
+ {
88
+ "tagName": "@remarks",
89
+ "syntaxKind": "block"
90
+ },
91
+ {
92
+ "tagName": "@returns",
93
+ "syntaxKind": "block"
94
+ },
95
+ {
96
+ "tagName": "@sealed",
97
+ "syntaxKind": "modifier"
98
+ },
99
+ {
100
+ "tagName": "@see",
101
+ "syntaxKind": "block"
102
+ },
103
+ {
104
+ "tagName": "@throws",
105
+ "syntaxKind": "block",
106
+ "allowMultiple": true
107
+ },
108
+ {
109
+ "tagName": "@typeParam",
110
+ "syntaxKind": "block",
111
+ "allowMultiple": true
112
+ },
113
+ {
114
+ "tagName": "@virtual",
115
+ "syntaxKind": "modifier"
116
+ },
117
+ {
118
+ "tagName": "@jsx",
119
+ "syntaxKind": "block"
120
+ },
121
+ {
122
+ "tagName": "@jsxRuntime",
123
+ "syntaxKind": "block"
124
+ },
125
+ {
126
+ "tagName": "@jsxFrag",
127
+ "syntaxKind": "block"
128
+ },
129
+ {
130
+ "tagName": "@jsxImportSource",
131
+ "syntaxKind": "block"
132
+ },
133
+ {
134
+ "tagName": "@betaDocumentation",
135
+ "syntaxKind": "modifier"
136
+ },
137
+ {
138
+ "tagName": "@internalRemarks",
139
+ "syntaxKind": "block"
140
+ },
141
+ {
142
+ "tagName": "@preapproved",
143
+ "syntaxKind": "modifier"
144
+ }
145
+ ],
146
+ "supportForTags": {
147
+ "@alpha": true,
148
+ "@beta": true,
149
+ "@defaultValue": true,
150
+ "@decorator": true,
151
+ "@deprecated": true,
152
+ "@eventProperty": true,
153
+ "@example": true,
154
+ "@experimental": true,
155
+ "@inheritDoc": true,
156
+ "@internal": true,
157
+ "@label": true,
158
+ "@link": true,
159
+ "@override": true,
160
+ "@packageDocumentation": true,
161
+ "@param": true,
162
+ "@privateRemarks": true,
163
+ "@public": true,
164
+ "@readonly": true,
165
+ "@remarks": true,
166
+ "@returns": true,
167
+ "@sealed": true,
168
+ "@see": true,
169
+ "@throws": true,
170
+ "@typeParam": true,
171
+ "@virtual": true,
172
+ "@betaDocumentation": true,
173
+ "@internalRemarks": true,
174
+ "@preapproved": true
175
+ },
176
+ "reportUnsupportedHtmlElements": false
177
+ }
178
+ },
179
+ "kind": "Package",
180
+ "canonicalReference": "@fgv/ts-extras-transformers!",
181
+ "docComment": "/**\n * `@fgv/ts-extras-transformers` — Result-integration boundary over `@huggingface/transformers` (Node-side).\n *\n * A thin facade that wraps `@huggingface/transformers` calls in `Result<T>` from `@fgv/ts-utils`, mirroring the discipline established by `@fgv/ts-extras-webauthn`: one-line `captureAsyncResult` wrappers around upstream primitives with **no opinionated orchestration** above the boundary.\n *\n * **In scope:** `loadPipeline`, `classify`, `classifyAll`, `embed` — the surface needed by the B-3/B-4a local-classifier and embedding scenarios. `generate` is explicitly deferred until a concrete consumer use case surfaces (see `phase-b2-result.md`).\n *\n * **Explicitly NOT in scope:** - Pipeline cache / lifecycle management - Model registry or download management - GPU/CPU device selection policy - Quantization selection - Embedding-store integration - Classifier label allowlists - Request batching - Pipeline dispose semantics\n *\n * For any of the above, use `@huggingface/transformers` directly (with `captureAsyncResult` for your own Result wrapping).\n *\n * @packageDocumentation\n */\n",
182
+ "name": "@fgv/ts-extras-transformers",
183
+ "preserveMemberOrder": false,
184
+ "members": [
185
+ {
186
+ "kind": "EntryPoint",
187
+ "canonicalReference": "@fgv/ts-extras-transformers!",
188
+ "name": "",
189
+ "preserveMemberOrder": false,
190
+ "members": [
191
+ {
192
+ "kind": "Function",
193
+ "canonicalReference": "@fgv/ts-extras-transformers!classify:function(1)",
194
+ "docComment": "/**\n * Result-integration wrapper that invokes a `TextClassificationPipeline` on a single text input. Returns the classification results as a flat `TextClassificationOutput` (array of `{ label: string; score: number }` entries).\n *\n * Callers should retrieve the pipeline via `loadPipeline('text-classification', modelId)` (or the `'sentiment-analysis'` alias). This helper always passes a single string to the upstream pipeline and normalises the result to `TextClassificationOutput` so consumers don't need to handle the `string | string[]` overload union.\n *\n * Returns `Promise<Result<TextClassificationOutput>>`; upstream errors (inference failures, tokenisation errors) are captured as `Failure` with the original message.\n *\n * @param classifier - A `TextClassificationPipeline` obtained from `loadPipeline`.\n *\n * @param text - The text to classify.\n *\n * @param options - Optional upstream classification options (e.g. `{ top_k: null }` to return all labels). Passed through verbatim to the pipeline call.\n *\n * @see\n *\n * https://huggingface.co/docs/transformers.js\n *\n * @public\n */\n",
195
+ "excerptTokens": [
196
+ {
197
+ "kind": "Content",
198
+ "text": "export declare function classify(classifier: "
199
+ },
200
+ {
201
+ "kind": "Reference",
202
+ "text": "TextClassificationPipeline",
203
+ "canonicalReference": "@huggingface/transformers!TextClassificationPipeline:class"
204
+ },
205
+ {
206
+ "kind": "Content",
207
+ "text": ", text: "
208
+ },
209
+ {
210
+ "kind": "Content",
211
+ "text": "string"
212
+ },
213
+ {
214
+ "kind": "Content",
215
+ "text": ", options?: "
216
+ },
217
+ {
218
+ "kind": "Reference",
219
+ "text": "Parameters",
220
+ "canonicalReference": "!Parameters:type"
221
+ },
222
+ {
223
+ "kind": "Content",
224
+ "text": "<"
225
+ },
226
+ {
227
+ "kind": "Reference",
228
+ "text": "TextClassificationPipeline",
229
+ "canonicalReference": "@huggingface/transformers!TextClassificationPipeline:class"
230
+ },
231
+ {
232
+ "kind": "Content",
233
+ "text": ">[1]"
234
+ },
235
+ {
236
+ "kind": "Content",
237
+ "text": "): "
238
+ },
239
+ {
240
+ "kind": "Reference",
241
+ "text": "Promise",
242
+ "canonicalReference": "!Promise:interface"
243
+ },
244
+ {
245
+ "kind": "Content",
246
+ "text": "<"
247
+ },
248
+ {
249
+ "kind": "Reference",
250
+ "text": "Result",
251
+ "canonicalReference": "@fgv/ts-utils!Result:type"
252
+ },
253
+ {
254
+ "kind": "Content",
255
+ "text": "<"
256
+ },
257
+ {
258
+ "kind": "Reference",
259
+ "text": "TextClassificationOutput",
260
+ "canonicalReference": "@huggingface/transformers!TextClassificationOutput:type"
261
+ },
262
+ {
263
+ "kind": "Content",
264
+ "text": ">>"
265
+ },
266
+ {
267
+ "kind": "Content",
268
+ "text": ";"
269
+ }
270
+ ],
271
+ "fileUrlPath": "src/index.ts",
272
+ "returnTypeTokenRange": {
273
+ "startIndex": 10,
274
+ "endIndex": 16
275
+ },
276
+ "releaseTag": "Public",
277
+ "overloadIndex": 1,
278
+ "parameters": [
279
+ {
280
+ "parameterName": "classifier",
281
+ "parameterTypeTokenRange": {
282
+ "startIndex": 1,
283
+ "endIndex": 2
284
+ },
285
+ "isOptional": false
286
+ },
287
+ {
288
+ "parameterName": "text",
289
+ "parameterTypeTokenRange": {
290
+ "startIndex": 3,
291
+ "endIndex": 4
292
+ },
293
+ "isOptional": false
294
+ },
295
+ {
296
+ "parameterName": "options",
297
+ "parameterTypeTokenRange": {
298
+ "startIndex": 5,
299
+ "endIndex": 9
300
+ },
301
+ "isOptional": true
302
+ }
303
+ ],
304
+ "name": "classify"
305
+ },
306
+ {
307
+ "kind": "Function",
308
+ "canonicalReference": "@fgv/ts-extras-transformers!classifyAll:function(1)",
309
+ "docComment": "/**\n * Convenience wrapper over `classify` that forces `top_k: null` so the full per-label vector is returned for every call. Callers no longer need to remember to pass `{ top_k: null }`.\n *\n * Any caller-supplied options are honoured except `top_k`, which is always overridden to `null`.\n *\n * Returns `Promise<Result<TextClassificationOutput>>`; upstream errors are captured as `Failure` with the original message.\n *\n * @param classifier - A `TextClassificationPipeline` obtained from `loadPipeline`.\n *\n * @param text - The text to classify.\n *\n * @param options - Optional upstream classification options. `top_k` is always set to `null` regardless of any value supplied here.\n *\n * @see\n *\n * https://huggingface.co/docs/transformers.js\n *\n * @public\n */\n",
310
+ "excerptTokens": [
311
+ {
312
+ "kind": "Content",
313
+ "text": "export declare function classifyAll(classifier: "
314
+ },
315
+ {
316
+ "kind": "Reference",
317
+ "text": "TextClassificationPipeline",
318
+ "canonicalReference": "@huggingface/transformers!TextClassificationPipeline:class"
319
+ },
320
+ {
321
+ "kind": "Content",
322
+ "text": ", text: "
323
+ },
324
+ {
325
+ "kind": "Content",
326
+ "text": "string"
327
+ },
328
+ {
329
+ "kind": "Content",
330
+ "text": ", options?: "
331
+ },
332
+ {
333
+ "kind": "Reference",
334
+ "text": "Parameters",
335
+ "canonicalReference": "!Parameters:type"
336
+ },
337
+ {
338
+ "kind": "Content",
339
+ "text": "<"
340
+ },
341
+ {
342
+ "kind": "Reference",
343
+ "text": "TextClassificationPipeline",
344
+ "canonicalReference": "@huggingface/transformers!TextClassificationPipeline:class"
345
+ },
346
+ {
347
+ "kind": "Content",
348
+ "text": ">[1]"
349
+ },
350
+ {
351
+ "kind": "Content",
352
+ "text": "): "
353
+ },
354
+ {
355
+ "kind": "Reference",
356
+ "text": "Promise",
357
+ "canonicalReference": "!Promise:interface"
358
+ },
359
+ {
360
+ "kind": "Content",
361
+ "text": "<"
362
+ },
363
+ {
364
+ "kind": "Reference",
365
+ "text": "Result",
366
+ "canonicalReference": "@fgv/ts-utils!Result:type"
367
+ },
368
+ {
369
+ "kind": "Content",
370
+ "text": "<"
371
+ },
372
+ {
373
+ "kind": "Reference",
374
+ "text": "TextClassificationOutput",
375
+ "canonicalReference": "@huggingface/transformers!TextClassificationOutput:type"
376
+ },
377
+ {
378
+ "kind": "Content",
379
+ "text": ">>"
380
+ },
381
+ {
382
+ "kind": "Content",
383
+ "text": ";"
384
+ }
385
+ ],
386
+ "fileUrlPath": "src/index.ts",
387
+ "returnTypeTokenRange": {
388
+ "startIndex": 10,
389
+ "endIndex": 16
390
+ },
391
+ "releaseTag": "Public",
392
+ "overloadIndex": 1,
393
+ "parameters": [
394
+ {
395
+ "parameterName": "classifier",
396
+ "parameterTypeTokenRange": {
397
+ "startIndex": 1,
398
+ "endIndex": 2
399
+ },
400
+ "isOptional": false
401
+ },
402
+ {
403
+ "parameterName": "text",
404
+ "parameterTypeTokenRange": {
405
+ "startIndex": 3,
406
+ "endIndex": 4
407
+ },
408
+ "isOptional": false
409
+ },
410
+ {
411
+ "parameterName": "options",
412
+ "parameterTypeTokenRange": {
413
+ "startIndex": 5,
414
+ "endIndex": 9
415
+ },
416
+ "isOptional": true
417
+ }
418
+ ],
419
+ "name": "classifyAll"
420
+ },
421
+ {
422
+ "kind": "Function",
423
+ "canonicalReference": "@fgv/ts-extras-transformers!embed:function(1)",
424
+ "docComment": "/**\n * Result-integration wrapper that invokes a `FeatureExtractionPipeline` on a text input. Returns the upstream `Tensor` Result-wrapped — no pooling, normalisation, or reshaping is applied. Callers receive the raw output and are responsible for any downstream processing.\n *\n * Callers should retrieve the extractor via `loadPipeline('feature-extraction', modelId)`.\n *\n * Returns `Promise<Result<Tensor>>`; upstream errors (inference failures, tokenisation errors) are captured as `Failure` with the original message.\n *\n * @param extractor - A `FeatureExtractionPipeline` obtained from `loadPipeline`.\n *\n * @param text - The text (or texts) to embed.\n *\n * @param options - Optional upstream feature-extraction options (e.g. `pooling`, `normalize`). Passed through verbatim to the pipeline call.\n *\n * @see\n *\n * https://huggingface.co/docs/transformers.js\n *\n * @public\n */\n",
425
+ "excerptTokens": [
426
+ {
427
+ "kind": "Content",
428
+ "text": "export declare function embed(extractor: "
429
+ },
430
+ {
431
+ "kind": "Reference",
432
+ "text": "FeatureExtractionPipeline",
433
+ "canonicalReference": "@huggingface/transformers!FeatureExtractionPipeline:class"
434
+ },
435
+ {
436
+ "kind": "Content",
437
+ "text": ", text: "
438
+ },
439
+ {
440
+ "kind": "Content",
441
+ "text": "string | string[]"
442
+ },
443
+ {
444
+ "kind": "Content",
445
+ "text": ", options?: "
446
+ },
447
+ {
448
+ "kind": "Reference",
449
+ "text": "Parameters",
450
+ "canonicalReference": "!Parameters:type"
451
+ },
452
+ {
453
+ "kind": "Content",
454
+ "text": "<"
455
+ },
456
+ {
457
+ "kind": "Reference",
458
+ "text": "FeatureExtractionPipeline",
459
+ "canonicalReference": "@huggingface/transformers!FeatureExtractionPipeline:class"
460
+ },
461
+ {
462
+ "kind": "Content",
463
+ "text": "['_call']>[1]"
464
+ },
465
+ {
466
+ "kind": "Content",
467
+ "text": "): "
468
+ },
469
+ {
470
+ "kind": "Reference",
471
+ "text": "Promise",
472
+ "canonicalReference": "!Promise:interface"
473
+ },
474
+ {
475
+ "kind": "Content",
476
+ "text": "<"
477
+ },
478
+ {
479
+ "kind": "Reference",
480
+ "text": "Result",
481
+ "canonicalReference": "@fgv/ts-utils!Result:type"
482
+ },
483
+ {
484
+ "kind": "Content",
485
+ "text": "<"
486
+ },
487
+ {
488
+ "kind": "Reference",
489
+ "text": "Tensor",
490
+ "canonicalReference": "@huggingface/transformers!Tensor:class"
491
+ },
492
+ {
493
+ "kind": "Content",
494
+ "text": ">>"
495
+ },
496
+ {
497
+ "kind": "Content",
498
+ "text": ";"
499
+ }
500
+ ],
501
+ "fileUrlPath": "src/index.ts",
502
+ "returnTypeTokenRange": {
503
+ "startIndex": 10,
504
+ "endIndex": 16
505
+ },
506
+ "releaseTag": "Public",
507
+ "overloadIndex": 1,
508
+ "parameters": [
509
+ {
510
+ "parameterName": "extractor",
511
+ "parameterTypeTokenRange": {
512
+ "startIndex": 1,
513
+ "endIndex": 2
514
+ },
515
+ "isOptional": false
516
+ },
517
+ {
518
+ "parameterName": "text",
519
+ "parameterTypeTokenRange": {
520
+ "startIndex": 3,
521
+ "endIndex": 4
522
+ },
523
+ "isOptional": false
524
+ },
525
+ {
526
+ "parameterName": "options",
527
+ "parameterTypeTokenRange": {
528
+ "startIndex": 5,
529
+ "endIndex": 9
530
+ },
531
+ "isOptional": true
532
+ }
533
+ ],
534
+ "name": "embed"
535
+ },
536
+ {
537
+ "kind": "Function",
538
+ "canonicalReference": "@fgv/ts-extras-transformers!loadPipeline:function(1)",
539
+ "docComment": "/**\n * Result-integration wrapper around `@huggingface/transformers`'s `pipeline` factory. Loads a model and returns a ready-to-use pipeline object.\n *\n * The returned pipeline is the upstream `AllTasks[T]` instance — consumers retain full access to the upstream API. Lifecycle management (caching, disposal, GPU/CPU selection) is the consumer's responsibility.\n *\n * Returns `Promise<Result<AllTasks[T]>>`; upstream errors (network, model-not-found, ONNX initialization failures) are captured as `Failure` with the original message.\n *\n * @param task - The pipeline task type (e.g. `'text-classification'`, `'feature-extraction'`).\n *\n * @param model - The model identifier (HuggingFace Hub ID or local path). If omitted, the upstream default for the task is used.\n *\n * @param options - Optional `PretrainedModelOptions` (device, dtype, cache_dir, etc.). Passed through verbatim to the upstream `pipeline()` call.\n *\n * @see\n *\n * https://huggingface.co/docs/transformers.js\n *\n * @public\n */\n",
540
+ "excerptTokens": [
541
+ {
542
+ "kind": "Content",
543
+ "text": "export declare function loadPipeline<T extends "
544
+ },
545
+ {
546
+ "kind": "Reference",
547
+ "text": "PipelineType",
548
+ "canonicalReference": "@huggingface/transformers!PipelineType:type"
549
+ },
550
+ {
551
+ "kind": "Content",
552
+ "text": ">(task: "
553
+ },
554
+ {
555
+ "kind": "Content",
556
+ "text": "T"
557
+ },
558
+ {
559
+ "kind": "Content",
560
+ "text": ", model?: "
561
+ },
562
+ {
563
+ "kind": "Content",
564
+ "text": "string"
565
+ },
566
+ {
567
+ "kind": "Content",
568
+ "text": ", options?: "
569
+ },
570
+ {
571
+ "kind": "Reference",
572
+ "text": "Parameters",
573
+ "canonicalReference": "!Parameters:type"
574
+ },
575
+ {
576
+ "kind": "Content",
577
+ "text": "<typeof "
578
+ },
579
+ {
580
+ "kind": "Reference",
581
+ "text": "_pipeline",
582
+ "canonicalReference": "@huggingface/transformers!pipeline:function"
583
+ },
584
+ {
585
+ "kind": "Content",
586
+ "text": ">[2]"
587
+ },
588
+ {
589
+ "kind": "Content",
590
+ "text": "): "
591
+ },
592
+ {
593
+ "kind": "Reference",
594
+ "text": "Promise",
595
+ "canonicalReference": "!Promise:interface"
596
+ },
597
+ {
598
+ "kind": "Content",
599
+ "text": "<"
600
+ },
601
+ {
602
+ "kind": "Reference",
603
+ "text": "Result",
604
+ "canonicalReference": "@fgv/ts-utils!Result:type"
605
+ },
606
+ {
607
+ "kind": "Content",
608
+ "text": "<"
609
+ },
610
+ {
611
+ "kind": "Reference",
612
+ "text": "AllTasks",
613
+ "canonicalReference": "@huggingface/transformers!AllTasks:type"
614
+ },
615
+ {
616
+ "kind": "Content",
617
+ "text": "[T]>>"
618
+ },
619
+ {
620
+ "kind": "Content",
621
+ "text": ";"
622
+ }
623
+ ],
624
+ "fileUrlPath": "src/index.ts",
625
+ "returnTypeTokenRange": {
626
+ "startIndex": 12,
627
+ "endIndex": 18
628
+ },
629
+ "releaseTag": "Public",
630
+ "overloadIndex": 1,
631
+ "parameters": [
632
+ {
633
+ "parameterName": "task",
634
+ "parameterTypeTokenRange": {
635
+ "startIndex": 3,
636
+ "endIndex": 4
637
+ },
638
+ "isOptional": false
639
+ },
640
+ {
641
+ "parameterName": "model",
642
+ "parameterTypeTokenRange": {
643
+ "startIndex": 5,
644
+ "endIndex": 6
645
+ },
646
+ "isOptional": true
647
+ },
648
+ {
649
+ "parameterName": "options",
650
+ "parameterTypeTokenRange": {
651
+ "startIndex": 7,
652
+ "endIndex": 11
653
+ },
654
+ "isOptional": true
655
+ }
656
+ ],
657
+ "typeParameters": [
658
+ {
659
+ "typeParameterName": "T",
660
+ "constraintTokenRange": {
661
+ "startIndex": 1,
662
+ "endIndex": 2
663
+ },
664
+ "defaultTypeTokenRange": {
665
+ "startIndex": 0,
666
+ "endIndex": 0
667
+ }
668
+ }
669
+ ],
670
+ "name": "loadPipeline"
671
+ }
672
+ ]
673
+ }
674
+ ]
675
+ }