@workglow/ai-provider 0.0.57 → 0.0.59
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 +1 -1
- package/dist/hf-transformers/common/HFT_Constants.d.ts +77 -11
- package/dist/hf-transformers/common/HFT_Constants.d.ts.map +1 -1
- package/dist/hf-transformers/common/HFT_JobRunFns.d.ts +8 -10
- package/dist/hf-transformers/common/HFT_JobRunFns.d.ts.map +1 -1
- package/dist/hf-transformers/common/HFT_ModelSchema.d.ts +172 -0
- package/dist/hf-transformers/common/HFT_ModelSchema.d.ts.map +1 -0
- package/dist/hf-transformers/index.d.ts +1 -0
- package/dist/hf-transformers/index.d.ts.map +1 -1
- package/dist/hf-transformers/registry/HFT_Client_RegisterJobFns.d.ts +11 -1
- package/dist/hf-transformers/registry/HFT_Client_RegisterJobFns.d.ts.map +1 -1
- package/dist/hf-transformers/registry/HFT_Inline_RegisterJobFns.d.ts +10 -1
- package/dist/hf-transformers/registry/HFT_Inline_RegisterJobFns.d.ts.map +1 -1
- package/dist/index.js +273 -39
- package/dist/index.js.map +12 -10
- package/dist/tf-mediapipe/common/TFMP_JobRunFns.d.ts +3 -2
- package/dist/tf-mediapipe/common/TFMP_JobRunFns.d.ts.map +1 -1
- package/dist/tf-mediapipe/common/TFMP_ModelSchema.d.ts +74 -0
- package/dist/tf-mediapipe/common/TFMP_ModelSchema.d.ts.map +1 -0
- package/dist/tf-mediapipe/index.d.ts +1 -0
- package/dist/tf-mediapipe/index.d.ts.map +1 -1
- package/dist/tf-mediapipe/registry/TFMP_Client_RegisterJobFns.d.ts +11 -1
- package/dist/tf-mediapipe/registry/TFMP_Client_RegisterJobFns.d.ts.map +1 -1
- package/dist/tf-mediapipe/registry/TFMP_Inline_RegisterJobFns.d.ts +10 -1
- package/dist/tf-mediapipe/registry/TFMP_Inline_RegisterJobFns.d.ts.map +1 -1
- package/package.json +11 -11
package/README.md
CHANGED
|
@@ -125,7 +125,7 @@ Supports ONNX models from HuggingFace Hub with the following task types:
|
|
|
125
125
|
Models support various quantization options:
|
|
126
126
|
|
|
127
127
|
```typescript
|
|
128
|
-
import {
|
|
128
|
+
import { QuantizationDataType } from "@workglow/ai-provider";
|
|
129
129
|
|
|
130
130
|
// Quantization options
|
|
131
131
|
// "auto" - Auto-detect based on environment
|
|
@@ -4,15 +4,81 @@
|
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
export declare const HF_TRANSFORMERS_ONNX = "HF_TRANSFORMERS_ONNX";
|
|
7
|
-
export
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
7
|
+
export type QuantizationDataType = "auto" | "fp32" | "fp16" | "q8" | "int8" | "uint8" | "q4" | "bnb4" | "q4f16";
|
|
8
|
+
export declare const QuantizationDataType: {
|
|
9
|
+
readonly auto: "auto";
|
|
10
|
+
readonly fp32: "fp32";
|
|
11
|
+
readonly fp16: "fp16";
|
|
12
|
+
readonly q8: "q8";
|
|
13
|
+
readonly int8: "int8";
|
|
14
|
+
readonly uint8: "uint8";
|
|
15
|
+
readonly q4: "q4";
|
|
16
|
+
readonly bnb4: "bnb4";
|
|
17
|
+
readonly q4f16: "q4f16";
|
|
18
|
+
};
|
|
19
|
+
export type TextPipelineUseCase = "fill-mask" | "token-classification" | "text-generation" | "text2text-generation" | "text-classification" | "summarization" | "translation" | "feature-extraction" | "zero-shot-classification" | "question-answering";
|
|
20
|
+
export declare const TextPipelineUseCase: {
|
|
21
|
+
readonly "fill-mask": "fill-mask";
|
|
22
|
+
readonly "token-classification": "token-classification";
|
|
23
|
+
readonly "text-generation": "text-generation";
|
|
24
|
+
readonly "text2text-generation": "text2text-generation";
|
|
25
|
+
readonly "text-classification": "text-classification";
|
|
26
|
+
readonly summarization: "summarization";
|
|
27
|
+
readonly translation: "translation";
|
|
28
|
+
readonly "feature-extraction": "feature-extraction";
|
|
29
|
+
readonly "zero-shot-classification": "zero-shot-classification";
|
|
30
|
+
readonly "question-answering": "question-answering";
|
|
31
|
+
};
|
|
32
|
+
export type VisionPipelineUseCase = "background-removal" | "image-segmentation" | "depth-estimation" | "image-classification" | "image-to-image" | "object-detection" | "image-feature-extraction";
|
|
33
|
+
export declare const VisionPipelineUseCase: {
|
|
34
|
+
readonly "background-removal": "background-removal";
|
|
35
|
+
readonly "image-segmentation": "image-segmentation";
|
|
36
|
+
readonly "depth-estimation": "depth-estimation";
|
|
37
|
+
readonly "image-classification": "image-classification";
|
|
38
|
+
readonly "image-to-image": "image-to-image";
|
|
39
|
+
readonly "object-detection": "object-detection";
|
|
40
|
+
readonly "image-feature-extraction": "image-feature-extraction";
|
|
41
|
+
};
|
|
42
|
+
export type AudioPipelineUseCase = "audio-classification" | "automatic-speech-recognition" | "text-to-speech";
|
|
43
|
+
export declare const AudioPipelineUseCase: {
|
|
44
|
+
readonly "audio-classification": "audio-classification";
|
|
45
|
+
readonly "automatic-speech-recognition": "automatic-speech-recognition";
|
|
46
|
+
readonly "text-to-speech": "text-to-speech";
|
|
47
|
+
};
|
|
48
|
+
export type MultimodalPipelineUseCase = "document-question-answering" | "image-to-text" | "zero-shot-audio-classification" | "zero-shot-image-classification" | "zero-shot-object-detection";
|
|
49
|
+
export declare const MultimodalPipelineUseCase: {
|
|
50
|
+
readonly "document-question-answering": "document-question-answering";
|
|
51
|
+
readonly "image-to-text": "image-to-text";
|
|
52
|
+
readonly "zero-shot-audio-classification": "zero-shot-audio-classification";
|
|
53
|
+
readonly "zero-shot-image-classification": "zero-shot-image-classification";
|
|
54
|
+
readonly "zero-shot-object-detection": "zero-shot-object-detection";
|
|
55
|
+
};
|
|
56
|
+
export type PipelineUseCase = TextPipelineUseCase | VisionPipelineUseCase | AudioPipelineUseCase | MultimodalPipelineUseCase;
|
|
57
|
+
export declare const PipelineUseCase: {
|
|
58
|
+
readonly "document-question-answering": "document-question-answering";
|
|
59
|
+
readonly "image-to-text": "image-to-text";
|
|
60
|
+
readonly "zero-shot-audio-classification": "zero-shot-audio-classification";
|
|
61
|
+
readonly "zero-shot-image-classification": "zero-shot-image-classification";
|
|
62
|
+
readonly "zero-shot-object-detection": "zero-shot-object-detection";
|
|
63
|
+
readonly "audio-classification": "audio-classification";
|
|
64
|
+
readonly "automatic-speech-recognition": "automatic-speech-recognition";
|
|
65
|
+
readonly "text-to-speech": "text-to-speech";
|
|
66
|
+
readonly "background-removal": "background-removal";
|
|
67
|
+
readonly "image-segmentation": "image-segmentation";
|
|
68
|
+
readonly "depth-estimation": "depth-estimation";
|
|
69
|
+
readonly "image-classification": "image-classification";
|
|
70
|
+
readonly "image-to-image": "image-to-image";
|
|
71
|
+
readonly "object-detection": "object-detection";
|
|
72
|
+
readonly "image-feature-extraction": "image-feature-extraction";
|
|
73
|
+
readonly "fill-mask": "fill-mask";
|
|
74
|
+
readonly "token-classification": "token-classification";
|
|
75
|
+
readonly "text-generation": "text-generation";
|
|
76
|
+
readonly "text2text-generation": "text2text-generation";
|
|
77
|
+
readonly "text-classification": "text-classification";
|
|
78
|
+
readonly summarization: "summarization";
|
|
79
|
+
readonly translation: "translation";
|
|
80
|
+
readonly "feature-extraction": "feature-extraction";
|
|
81
|
+
readonly "zero-shot-classification": "zero-shot-classification";
|
|
82
|
+
readonly "question-answering": "question-answering";
|
|
83
|
+
};
|
|
18
84
|
//# sourceMappingURL=HFT_Constants.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HFT_Constants.d.ts","sourceRoot":"","sources":["../../../src/hf-transformers/common/HFT_Constants.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,eAAO,MAAM,oBAAoB,yBAAyB,CAAC;AAE3D,
|
|
1
|
+
{"version":3,"file":"HFT_Constants.d.ts","sourceRoot":"","sources":["../../../src/hf-transformers/common/HFT_Constants.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,eAAO,MAAM,oBAAoB,yBAAyB,CAAC;AAE3D,MAAM,MAAM,oBAAoB,GAC5B,MAAM,GACN,MAAM,GACN,MAAM,GACN,IAAI,GACJ,MAAM,GACN,OAAO,GACP,IAAI,GACJ,MAAM,GACN,OAAO,CAAC;AAEZ,eAAO,MAAM,oBAAoB;;;;;;;;;;CAUsC,CAAC;AAExE,MAAM,MAAM,mBAAmB,GAC3B,WAAW,GACX,sBAAsB,GACtB,iBAAiB,GACjB,sBAAsB,GACtB,qBAAqB,GACrB,eAAe,GACf,aAAa,GACb,oBAAoB,GACpB,0BAA0B,GAC1B,oBAAoB,CAAC;AAEzB,eAAO,MAAM,mBAAmB;;;;;;;;;;;CAWqC,CAAC;AAEtE,MAAM,MAAM,qBAAqB,GAC7B,oBAAoB,GACpB,oBAAoB,GACpB,kBAAkB,GAClB,sBAAsB,GACtB,gBAAgB,GAChB,kBAAkB,GAClB,0BAA0B,CAAC;AAE/B,eAAO,MAAM,qBAAqB;;;;;;;;CAQuC,CAAC;AAE1E,MAAM,MAAM,oBAAoB,GAC5B,sBAAsB,GACtB,8BAA8B,GAC9B,gBAAgB,CAAC;AAErB,eAAO,MAAM,oBAAoB;;;;CAIsC,CAAC;AAExE,MAAM,MAAM,yBAAyB,GACjC,6BAA6B,GAC7B,eAAe,GACf,gCAAgC,GAChC,gCAAgC,GAChC,4BAA4B,CAAC;AAEjC,eAAO,MAAM,yBAAyB;;;;;;CAM2C,CAAC;AAElF,MAAM,MAAM,eAAe,GACvB,mBAAmB,GACnB,qBAAqB,GACrB,oBAAoB,GACpB,yBAAyB,CAAC;AAE9B,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;CAKiC,CAAC"}
|
|
@@ -4,42 +4,40 @@
|
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
import { AiProviderRunFn, type DeReplicateFromSchema, DownloadModelTaskExecuteInput, TextEmbeddingInputSchema, TextEmbeddingOutputSchema, TextGenerationInputSchema, TextGenerationOutputSchema, TextQuestionAnswerInputSchema, TextQuestionAnswerOutputSchema, TextRewriterInputSchema, TextRewriterOutputSchema, TextSummaryInputSchema, TextSummaryOutputSchema, TextTranslationInputSchema, TextTranslationOutputSchema } from "@workglow/ai";
|
|
7
|
+
import { HfTransformersOnnxModelRecord } from "./HFT_ModelSchema";
|
|
7
8
|
/**
|
|
8
9
|
* Core implementation for downloading and caching a Hugging Face Transformers model.
|
|
9
10
|
* This is shared between inline and worker implementations.
|
|
10
11
|
*/
|
|
11
|
-
export declare const HFT_Download: AiProviderRunFn<DownloadModelTaskExecuteInput, DownloadModelTaskExecuteInput>;
|
|
12
|
+
export declare const HFT_Download: AiProviderRunFn<DownloadModelTaskExecuteInput, DownloadModelTaskExecuteInput, HfTransformersOnnxModelRecord>;
|
|
12
13
|
/**
|
|
13
14
|
* Core implementation for text embedding using Hugging Face Transformers.
|
|
14
15
|
* This is shared between inline and worker implementations.
|
|
15
16
|
*/
|
|
16
|
-
|
|
17
|
-
type TextEmbeddingOutput = DeReplicateFromSchema<typeof TextEmbeddingOutputSchema>;
|
|
18
|
-
export declare const HFT_TextEmbedding: AiProviderRunFn<TextEmbeddingInput, TextEmbeddingOutput>;
|
|
17
|
+
export declare const HFT_TextEmbedding: AiProviderRunFn<DeReplicateFromSchema<typeof TextEmbeddingInputSchema>, DeReplicateFromSchema<typeof TextEmbeddingOutputSchema>, HfTransformersOnnxModelRecord>;
|
|
19
18
|
/**
|
|
20
19
|
* Core implementation for text generation using Hugging Face Transformers.
|
|
21
20
|
* This is shared between inline and worker implementations.
|
|
22
21
|
*/
|
|
23
|
-
export declare const HFT_TextGeneration: AiProviderRunFn<DeReplicateFromSchema<typeof TextGenerationInputSchema>, DeReplicateFromSchema<typeof TextGenerationOutputSchema
|
|
22
|
+
export declare const HFT_TextGeneration: AiProviderRunFn<DeReplicateFromSchema<typeof TextGenerationInputSchema>, DeReplicateFromSchema<typeof TextGenerationOutputSchema>, HfTransformersOnnxModelRecord>;
|
|
24
23
|
/**
|
|
25
24
|
* Core implementation for text translation using Hugging Face Transformers.
|
|
26
25
|
* This is shared between inline and worker implementations.
|
|
27
26
|
*/
|
|
28
|
-
export declare const HFT_TextTranslation: AiProviderRunFn<DeReplicateFromSchema<typeof TextTranslationInputSchema>, DeReplicateFromSchema<typeof TextTranslationOutputSchema
|
|
27
|
+
export declare const HFT_TextTranslation: AiProviderRunFn<DeReplicateFromSchema<typeof TextTranslationInputSchema>, DeReplicateFromSchema<typeof TextTranslationOutputSchema>, HfTransformersOnnxModelRecord>;
|
|
29
28
|
/**
|
|
30
29
|
* Core implementation for text rewriting using Hugging Face Transformers.
|
|
31
30
|
* This is shared between inline and worker implementations.
|
|
32
31
|
*/
|
|
33
|
-
export declare const HFT_TextRewriter: AiProviderRunFn<DeReplicateFromSchema<typeof TextRewriterInputSchema>, DeReplicateFromSchema<typeof TextRewriterOutputSchema
|
|
32
|
+
export declare const HFT_TextRewriter: AiProviderRunFn<DeReplicateFromSchema<typeof TextRewriterInputSchema>, DeReplicateFromSchema<typeof TextRewriterOutputSchema>, HfTransformersOnnxModelRecord>;
|
|
34
33
|
/**
|
|
35
34
|
* Core implementation for text summarization using Hugging Face Transformers.
|
|
36
35
|
* This is shared between inline and worker implementations.
|
|
37
36
|
*/
|
|
38
|
-
export declare const HFT_TextSummary: AiProviderRunFn<DeReplicateFromSchema<typeof TextSummaryInputSchema>, DeReplicateFromSchema<typeof TextSummaryOutputSchema
|
|
37
|
+
export declare const HFT_TextSummary: AiProviderRunFn<DeReplicateFromSchema<typeof TextSummaryInputSchema>, DeReplicateFromSchema<typeof TextSummaryOutputSchema>, HfTransformersOnnxModelRecord>;
|
|
39
38
|
/**
|
|
40
39
|
* Core implementation for question answering using Hugging Face Transformers.
|
|
41
40
|
* This is shared between inline and worker implementations.
|
|
42
41
|
*/
|
|
43
|
-
export declare const HFT_TextQuestionAnswer: AiProviderRunFn<DeReplicateFromSchema<typeof TextQuestionAnswerInputSchema>, DeReplicateFromSchema<typeof TextQuestionAnswerOutputSchema
|
|
44
|
-
export {};
|
|
42
|
+
export declare const HFT_TextQuestionAnswer: AiProviderRunFn<DeReplicateFromSchema<typeof TextQuestionAnswerInputSchema>, DeReplicateFromSchema<typeof TextQuestionAnswerOutputSchema>, HfTransformersOnnxModelRecord>;
|
|
45
43
|
//# sourceMappingURL=HFT_JobRunFns.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HFT_JobRunFns.d.ts","sourceRoot":"","sources":["../../../src/hf-transformers/common/HFT_JobRunFns.ts"],"names":[],"mappings":"AAAA;;;;GAIG;
|
|
1
|
+
{"version":3,"file":"HFT_JobRunFns.d.ts","sourceRoot":"","sources":["../../../src/hf-transformers/common/HFT_JobRunFns.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAiBH,OAAO,EACL,eAAe,EACf,KAAK,qBAAqB,EAC1B,6BAA6B,EAC7B,wBAAwB,EACxB,yBAAyB,EACzB,yBAAyB,EACzB,0BAA0B,EAC1B,6BAA6B,EAC7B,8BAA8B,EAC9B,uBAAuB,EACvB,wBAAwB,EACxB,sBAAsB,EACtB,uBAAuB,EACvB,0BAA0B,EAC1B,2BAA2B,EAE5B,MAAM,cAAc,CAAC;AAGtB,OAAO,EAAE,6BAA6B,EAAE,MAAM,mBAAmB,CAAC;AA2ClE;;;GAGG;AACH,eAAO,MAAM,YAAY,EAAE,eAAe,CACxC,6BAA6B,EAC7B,6BAA6B,EAC7B,6BAA6B,CAQ9B,CAAC;AAEF;;;GAGG;AAEH,eAAO,MAAM,iBAAiB,EAAE,eAAe,CAC7C,qBAAqB,CAAC,OAAO,wBAAwB,CAAC,EACtD,qBAAqB,CAAC,OAAO,yBAAyB,CAAC,EACvD,6BAA6B,CA0B9B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,kBAAkB,EAAE,eAAe,CAC9C,qBAAqB,CAAC,OAAO,yBAAyB,CAAC,EACvD,qBAAqB,CAAC,OAAO,0BAA0B,CAAC,EACxD,6BAA6B,CAwB9B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,mBAAmB,EAAE,eAAe,CAC/C,qBAAqB,CAAC,OAAO,0BAA0B,CAAC,EACxD,qBAAqB,CAAC,OAAO,2BAA2B,CAAC,EACzD,6BAA6B,CAyB9B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,gBAAgB,EAAE,eAAe,CAC5C,qBAAqB,CAAC,OAAO,uBAAuB,CAAC,EACrD,qBAAqB,CAAC,OAAO,wBAAwB,CAAC,EACtD,6BAA6B,CA+B9B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,eAAe,EAAE,eAAe,CAC3C,qBAAqB,CAAC,OAAO,sBAAsB,CAAC,EACpD,qBAAqB,CAAC,OAAO,uBAAuB,CAAC,EACrD,6BAA6B,CAsB9B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,sBAAsB,EAAE,eAAe,CAClD,qBAAqB,CAAC,OAAO,6BAA6B,CAAC,EAC3D,qBAAqB,CAAC,OAAO,8BAA8B,CAAC,EAC5D,6BAA6B,CAuB9B,CAAC"}
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Steven Roussey <sroussey@gmail.com>
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { FromSchema } from "@workglow/util";
|
|
7
|
+
export declare const HfTransformersOnnxModelSchema: {
|
|
8
|
+
readonly type: "object";
|
|
9
|
+
readonly properties: {
|
|
10
|
+
readonly provider: {
|
|
11
|
+
readonly const: "HF_TRANSFORMERS_ONNX";
|
|
12
|
+
readonly description: "Discriminator: ONNX runtime backend.";
|
|
13
|
+
};
|
|
14
|
+
readonly providerConfig: {
|
|
15
|
+
readonly type: "object";
|
|
16
|
+
readonly description: "ONNX runtime-specific options.";
|
|
17
|
+
readonly properties: {
|
|
18
|
+
readonly pipeline: {
|
|
19
|
+
readonly type: "string";
|
|
20
|
+
readonly enum: ("fill-mask" | "token-classification" | "text-generation" | "text2text-generation" | "text-classification" | "summarization" | "translation" | "feature-extraction" | "zero-shot-classification" | "question-answering" | "background-removal" | "image-segmentation" | "depth-estimation" | "image-classification" | "image-to-image" | "object-detection" | "image-feature-extraction" | "audio-classification" | "automatic-speech-recognition" | "text-to-speech" | "document-question-answering" | "image-to-text" | "zero-shot-audio-classification" | "zero-shot-image-classification" | "zero-shot-object-detection")[];
|
|
21
|
+
readonly description: "Pipeline type for the ONNX model.";
|
|
22
|
+
readonly default: "text-generation";
|
|
23
|
+
};
|
|
24
|
+
readonly modelPath: {
|
|
25
|
+
readonly type: "string";
|
|
26
|
+
readonly description: "Filesystem path or URI for the ONNX model.";
|
|
27
|
+
};
|
|
28
|
+
readonly dType: {
|
|
29
|
+
readonly type: "string";
|
|
30
|
+
readonly enum: ("auto" | "fp32" | "fp16" | "q8" | "int8" | "uint8" | "q4" | "bnb4" | "q4f16")[];
|
|
31
|
+
readonly description: "Data type for the ONNX model.";
|
|
32
|
+
readonly default: "float32";
|
|
33
|
+
};
|
|
34
|
+
readonly device: {
|
|
35
|
+
readonly type: "string";
|
|
36
|
+
readonly enum: readonly ["cpu", "gpu", "webgpu", "wasm", "metal"];
|
|
37
|
+
readonly description: "High-level device selection.";
|
|
38
|
+
readonly default: "webgpu";
|
|
39
|
+
};
|
|
40
|
+
readonly executionProviders: {
|
|
41
|
+
readonly type: "array";
|
|
42
|
+
readonly items: {
|
|
43
|
+
readonly type: "string";
|
|
44
|
+
};
|
|
45
|
+
readonly description: "Raw ONNX Runtime execution provider identifiers.";
|
|
46
|
+
};
|
|
47
|
+
readonly intraOpNumThreads: {
|
|
48
|
+
readonly type: "integer";
|
|
49
|
+
readonly minimum: 1;
|
|
50
|
+
};
|
|
51
|
+
readonly interOpNumThreads: {
|
|
52
|
+
readonly type: "integer";
|
|
53
|
+
readonly minimum: 1;
|
|
54
|
+
};
|
|
55
|
+
readonly useExternalDataFormat: {
|
|
56
|
+
readonly type: "boolean";
|
|
57
|
+
readonly description: "Whether the model uses external data format.";
|
|
58
|
+
};
|
|
59
|
+
readonly nativeDimensions: {
|
|
60
|
+
readonly type: "integer";
|
|
61
|
+
readonly description: "The native dimensions of the model.";
|
|
62
|
+
};
|
|
63
|
+
readonly normalize: {
|
|
64
|
+
readonly type: "boolean";
|
|
65
|
+
readonly description: "Whether the model uses normalization.";
|
|
66
|
+
};
|
|
67
|
+
readonly languageStyle: {
|
|
68
|
+
readonly type: "string";
|
|
69
|
+
readonly description: "The language style of the model.";
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
readonly required: readonly ["modelPath", "pipeline"];
|
|
73
|
+
readonly additionalProperties: false;
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
readonly required: readonly ["provider", "providerConfig"];
|
|
77
|
+
readonly additionalProperties: true;
|
|
78
|
+
};
|
|
79
|
+
declare const ExtendedModelSchema: {
|
|
80
|
+
readonly type: "object";
|
|
81
|
+
readonly properties: {
|
|
82
|
+
readonly provider: {
|
|
83
|
+
readonly const: "HF_TRANSFORMERS_ONNX";
|
|
84
|
+
readonly description: "Discriminator: ONNX runtime backend.";
|
|
85
|
+
};
|
|
86
|
+
readonly providerConfig: {
|
|
87
|
+
readonly type: "object";
|
|
88
|
+
readonly description: "ONNX runtime-specific options.";
|
|
89
|
+
readonly properties: {
|
|
90
|
+
readonly pipeline: {
|
|
91
|
+
readonly type: "string";
|
|
92
|
+
readonly enum: ("fill-mask" | "token-classification" | "text-generation" | "text2text-generation" | "text-classification" | "summarization" | "translation" | "feature-extraction" | "zero-shot-classification" | "question-answering" | "background-removal" | "image-segmentation" | "depth-estimation" | "image-classification" | "image-to-image" | "object-detection" | "image-feature-extraction" | "audio-classification" | "automatic-speech-recognition" | "text-to-speech" | "document-question-answering" | "image-to-text" | "zero-shot-audio-classification" | "zero-shot-image-classification" | "zero-shot-object-detection")[];
|
|
93
|
+
readonly description: "Pipeline type for the ONNX model.";
|
|
94
|
+
readonly default: "text-generation";
|
|
95
|
+
};
|
|
96
|
+
readonly modelPath: {
|
|
97
|
+
readonly type: "string";
|
|
98
|
+
readonly description: "Filesystem path or URI for the ONNX model.";
|
|
99
|
+
};
|
|
100
|
+
readonly dType: {
|
|
101
|
+
readonly type: "string";
|
|
102
|
+
readonly enum: ("auto" | "fp32" | "fp16" | "q8" | "int8" | "uint8" | "q4" | "bnb4" | "q4f16")[];
|
|
103
|
+
readonly description: "Data type for the ONNX model.";
|
|
104
|
+
readonly default: "float32";
|
|
105
|
+
};
|
|
106
|
+
readonly device: {
|
|
107
|
+
readonly type: "string";
|
|
108
|
+
readonly enum: readonly ["cpu", "gpu", "webgpu", "wasm", "metal"];
|
|
109
|
+
readonly description: "High-level device selection.";
|
|
110
|
+
readonly default: "webgpu";
|
|
111
|
+
};
|
|
112
|
+
readonly executionProviders: {
|
|
113
|
+
readonly type: "array";
|
|
114
|
+
readonly items: {
|
|
115
|
+
readonly type: "string";
|
|
116
|
+
};
|
|
117
|
+
readonly description: "Raw ONNX Runtime execution provider identifiers.";
|
|
118
|
+
};
|
|
119
|
+
readonly intraOpNumThreads: {
|
|
120
|
+
readonly type: "integer";
|
|
121
|
+
readonly minimum: 1;
|
|
122
|
+
};
|
|
123
|
+
readonly interOpNumThreads: {
|
|
124
|
+
readonly type: "integer";
|
|
125
|
+
readonly minimum: 1;
|
|
126
|
+
};
|
|
127
|
+
readonly useExternalDataFormat: {
|
|
128
|
+
readonly type: "boolean";
|
|
129
|
+
readonly description: "Whether the model uses external data format.";
|
|
130
|
+
};
|
|
131
|
+
readonly nativeDimensions: {
|
|
132
|
+
readonly type: "integer";
|
|
133
|
+
readonly description: "The native dimensions of the model.";
|
|
134
|
+
};
|
|
135
|
+
readonly normalize: {
|
|
136
|
+
readonly type: "boolean";
|
|
137
|
+
readonly description: "Whether the model uses normalization.";
|
|
138
|
+
};
|
|
139
|
+
readonly languageStyle: {
|
|
140
|
+
readonly type: "string";
|
|
141
|
+
readonly description: "The language style of the model.";
|
|
142
|
+
};
|
|
143
|
+
};
|
|
144
|
+
readonly required: readonly ["modelPath", "pipeline"];
|
|
145
|
+
readonly additionalProperties: false;
|
|
146
|
+
};
|
|
147
|
+
readonly model_id: {
|
|
148
|
+
readonly type: "string";
|
|
149
|
+
};
|
|
150
|
+
readonly tasks: {
|
|
151
|
+
readonly type: "array";
|
|
152
|
+
readonly items: {
|
|
153
|
+
readonly type: "string";
|
|
154
|
+
};
|
|
155
|
+
};
|
|
156
|
+
readonly title: {
|
|
157
|
+
readonly type: "string";
|
|
158
|
+
};
|
|
159
|
+
readonly description: {
|
|
160
|
+
readonly type: "string";
|
|
161
|
+
};
|
|
162
|
+
readonly metadata: {
|
|
163
|
+
readonly type: "object";
|
|
164
|
+
readonly default: {};
|
|
165
|
+
};
|
|
166
|
+
};
|
|
167
|
+
readonly required: readonly ["model_id", "tasks", "provider", "title", "description", "providerConfig", "metadata", "provider", "providerConfig"];
|
|
168
|
+
readonly additionalProperties: false;
|
|
169
|
+
};
|
|
170
|
+
export type HfTransformersOnnxModelRecord = FromSchema<typeof ExtendedModelSchema>;
|
|
171
|
+
export {};
|
|
172
|
+
//# sourceMappingURL=HFT_ModelSchema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HFT_ModelSchema.d.ts","sourceRoot":"","sources":["../../../src/hf-transformers/common/HFT_ModelSchema.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAwB,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAGlE,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqED,CAAC;AAE1C,QAAA,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAQgB,CAAC;AAE1C,MAAM,MAAM,6BAA6B,GAAG,UAAU,CAAC,OAAO,mBAAmB,CAAC,CAAC"}
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
export * from "./common/HFT_Constants";
|
|
7
7
|
export * from "./common/HFT_JobRunFns";
|
|
8
|
+
export * from "./common/HFT_ModelSchema";
|
|
8
9
|
export * from "./registry/HFT_Client_RegisterJobFns";
|
|
9
10
|
export * from "./registry/HFT_Inline_RegisterJobFns";
|
|
10
11
|
export * from "./registry/HFT_Worker_RegisterJobFns";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hf-transformers/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,sCAAsC,CAAC;AACrD,cAAc,sCAAsC,CAAC;AACrD,cAAc,sCAAsC,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hf-transformers/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,0BAA0B,CAAC;AACzC,cAAc,sCAAsC,CAAC;AACrD,cAAc,sCAAsC,CAAC;AACrD,cAAc,sCAAsC,CAAC"}
|
|
@@ -3,5 +3,15 @@
|
|
|
3
3
|
* Copyright 2025 Steven Roussey <sroussey@gmail.com>
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
|
|
6
|
+
import { AiJobInput } from "@workglow/ai";
|
|
7
|
+
import { JobQueueClient } from "@workglow/job-queue";
|
|
8
|
+
import { TaskInput, TaskOutput } from "@workglow/task-graph";
|
|
9
|
+
/**
|
|
10
|
+
* Registers the HuggingFace Transformers client job functions with a web worker.
|
|
11
|
+
* If no client is provided, creates a default in-memory queue and registers it.
|
|
12
|
+
*
|
|
13
|
+
* @param worker - The web worker to use for job execution
|
|
14
|
+
* @param client - Optional existing JobQueueClient. If not provided, creates a default in-memory queue.
|
|
15
|
+
*/
|
|
16
|
+
export declare function register_HFT_ClientJobFns(worker: Worker, client?: JobQueueClient<AiJobInput<TaskInput>, TaskOutput>): Promise<void>;
|
|
7
17
|
//# sourceMappingURL=HFT_Client_RegisterJobFns.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HFT_Client_RegisterJobFns.d.ts","sourceRoot":"","sources":["../../../src/hf-transformers/registry/HFT_Client_RegisterJobFns.ts"],"names":[],"mappings":"AAAA;;;;GAIG;
|
|
1
|
+
{"version":3,"file":"HFT_Client_RegisterJobFns.d.ts","sourceRoot":"","sources":["../../../src/hf-transformers/registry/HFT_Client_RegisterJobFns.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAS,UAAU,EAAyB,MAAM,cAAc,CAAC;AACxE,OAAO,EAAsB,cAAc,EAAkB,MAAM,qBAAqB,CAAC;AAEzF,OAAO,EAAwB,SAAS,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAInF;;;;;;GAMG;AACH,wBAAsB,yBAAyB,CAC7C,MAAM,EAAE,MAAM,EACd,MAAM,CAAC,EAAE,cAAc,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,UAAU,CAAC,GACzD,OAAO,CAAC,IAAI,CAAC,CAwCf"}
|
|
@@ -3,5 +3,14 @@
|
|
|
3
3
|
* Copyright 2025 Steven Roussey <sroussey@gmail.com>
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
|
|
6
|
+
import { AiJobInput } from "@workglow/ai";
|
|
7
|
+
import { JobQueueClient } from "@workglow/job-queue";
|
|
8
|
+
import { TaskInput, TaskOutput } from "@workglow/task-graph";
|
|
9
|
+
/**
|
|
10
|
+
* Registers the HuggingFace Transformers inline job functions for same-thread execution.
|
|
11
|
+
* If no client is provided, creates a default in-memory queue and registers it.
|
|
12
|
+
*
|
|
13
|
+
* @param client - Optional existing JobQueueClient. If not provided, creates a default in-memory queue.
|
|
14
|
+
*/
|
|
15
|
+
export declare function register_HFT_InlineJobFns(client?: JobQueueClient<AiJobInput<TaskInput>, TaskOutput>): Promise<void>;
|
|
7
16
|
//# sourceMappingURL=HFT_Inline_RegisterJobFns.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HFT_Inline_RegisterJobFns.d.ts","sourceRoot":"","sources":["../../../src/hf-transformers/registry/HFT_Inline_RegisterJobFns.ts"],"names":[],"mappings":"AAAA;;;;GAIG;
|
|
1
|
+
{"version":3,"file":"HFT_Inline_RegisterJobFns.d.ts","sourceRoot":"","sources":["../../../src/hf-transformers/registry/HFT_Inline_RegisterJobFns.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAS,UAAU,EAA0C,MAAM,cAAc,CAAC;AACzF,OAAO,EAAsB,cAAc,EAAkB,MAAM,qBAAqB,CAAC;AAEzF,OAAO,EAAwB,SAAS,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAYnF;;;;;GAKG;AACH,wBAAsB,yBAAyB,CAC7C,MAAM,CAAC,EAAE,cAAc,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,UAAU,CAAC,GACzD,OAAO,CAAC,IAAI,CAAC,CAwCf"}
|