@huggingface/tasks 0.9.0 → 0.10.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 +12 -14
- package/dist/index.cjs +91 -18
- package/dist/index.js +90 -18
- package/dist/scripts/inference-codegen.d.ts +2 -0
- package/dist/scripts/inference-codegen.d.ts.map +1 -0
- package/dist/scripts/inference-tgi-import.d.ts +2 -0
- package/dist/scripts/inference-tgi-import.d.ts.map +1 -0
- package/dist/src/default-widget-inputs.d.ts +6 -0
- package/dist/src/default-widget-inputs.d.ts.map +1 -0
- package/dist/src/index.d.ts +17 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/library-to-tasks.d.ts +11 -0
- package/dist/src/library-to-tasks.d.ts.map +1 -0
- package/dist/src/local-apps.d.ts +104 -0
- package/dist/src/local-apps.d.ts.map +1 -0
- package/dist/src/model-data.d.ts +144 -0
- package/dist/src/model-data.d.ts.map +1 -0
- package/dist/src/model-libraries-downloads.d.ts +26 -0
- package/dist/src/model-libraries-downloads.d.ts.map +1 -0
- package/dist/src/model-libraries-snippets.d.ts +43 -0
- package/dist/src/model-libraries-snippets.d.ts.map +1 -0
- package/dist/src/model-libraries.d.ts +490 -0
- package/dist/src/model-libraries.d.ts.map +1 -0
- package/dist/src/pipelines.d.ts +404 -0
- package/dist/src/pipelines.d.ts.map +1 -0
- package/dist/src/snippets/curl.d.ts +9 -0
- package/dist/src/snippets/curl.d.ts.map +1 -0
- package/dist/src/snippets/index.d.ts +6 -0
- package/dist/src/snippets/index.d.ts.map +1 -0
- package/dist/src/snippets/inputs.d.ts +3 -0
- package/dist/src/snippets/inputs.d.ts.map +1 -0
- package/dist/src/snippets/js.d.ts +11 -0
- package/dist/src/snippets/js.d.ts.map +1 -0
- package/dist/src/snippets/python.d.ts +14 -0
- package/dist/src/snippets/python.d.ts.map +1 -0
- package/dist/src/snippets/types.d.ts +8 -0
- package/dist/src/snippets/types.d.ts.map +1 -0
- package/dist/src/tasks/audio-classification/data.d.ts +4 -0
- package/dist/src/tasks/audio-classification/data.d.ts.map +1 -0
- package/dist/src/tasks/audio-classification/inference.d.ts +52 -0
- package/dist/src/tasks/audio-classification/inference.d.ts.map +1 -0
- package/dist/src/tasks/audio-to-audio/data.d.ts +4 -0
- package/dist/src/tasks/audio-to-audio/data.d.ts.map +1 -0
- package/dist/src/tasks/automatic-speech-recognition/data.d.ts +4 -0
- package/dist/src/tasks/automatic-speech-recognition/data.d.ts.map +1 -0
- package/dist/src/tasks/automatic-speech-recognition/inference.d.ts +154 -0
- package/dist/src/tasks/automatic-speech-recognition/inference.d.ts.map +1 -0
- package/dist/src/tasks/chat-completion/inference.d.ts +254 -0
- package/dist/src/tasks/chat-completion/inference.d.ts.map +1 -0
- package/dist/src/tasks/depth-estimation/data.d.ts +4 -0
- package/dist/src/tasks/depth-estimation/data.d.ts.map +1 -0
- package/dist/src/tasks/depth-estimation/inference.d.ts +36 -0
- package/dist/src/tasks/depth-estimation/inference.d.ts.map +1 -0
- package/dist/src/tasks/document-question-answering/data.d.ts +4 -0
- package/dist/src/tasks/document-question-answering/data.d.ts.map +1 -0
- package/dist/src/tasks/document-question-answering/inference.d.ts +111 -0
- package/dist/src/tasks/document-question-answering/inference.d.ts.map +1 -0
- package/dist/src/tasks/feature-extraction/data.d.ts +4 -0
- package/dist/src/tasks/feature-extraction/data.d.ts.map +1 -0
- package/dist/src/tasks/feature-extraction/inference.d.ts +23 -0
- package/dist/src/tasks/feature-extraction/inference.d.ts.map +1 -0
- package/dist/src/tasks/fill-mask/data.d.ts +4 -0
- package/dist/src/tasks/fill-mask/data.d.ts.map +1 -0
- package/dist/src/tasks/fill-mask/inference.d.ts +63 -0
- package/dist/src/tasks/fill-mask/inference.d.ts.map +1 -0
- package/dist/src/tasks/image-classification/data.d.ts +4 -0
- package/dist/src/tasks/image-classification/data.d.ts.map +1 -0
- package/dist/src/tasks/image-classification/inference.d.ts +52 -0
- package/dist/src/tasks/image-classification/inference.d.ts.map +1 -0
- package/dist/src/tasks/image-feature-extraction/data.d.ts +4 -0
- package/dist/src/tasks/image-feature-extraction/data.d.ts.map +1 -0
- package/dist/src/tasks/image-segmentation/data.d.ts +4 -0
- package/dist/src/tasks/image-segmentation/data.d.ts.map +1 -0
- package/dist/src/tasks/image-segmentation/inference.d.ts +66 -0
- package/dist/src/tasks/image-segmentation/inference.d.ts.map +1 -0
- package/dist/src/tasks/image-to-image/data.d.ts +4 -0
- package/dist/src/tasks/image-to-image/data.d.ts.map +1 -0
- package/dist/src/tasks/image-to-image/inference.d.ts +64 -0
- package/dist/src/tasks/image-to-image/inference.d.ts.map +1 -0
- package/dist/src/tasks/image-to-text/data.d.ts +4 -0
- package/dist/src/tasks/image-to-text/data.d.ts.map +1 -0
- package/dist/src/tasks/image-to-text/inference.d.ts +139 -0
- package/dist/src/tasks/image-to-text/inference.d.ts.map +1 -0
- package/dist/src/tasks/index.d.ts +87 -0
- package/dist/src/tasks/index.d.ts.map +1 -0
- package/dist/src/tasks/mask-generation/data.d.ts +4 -0
- package/dist/src/tasks/mask-generation/data.d.ts.map +1 -0
- package/dist/src/tasks/object-detection/data.d.ts +4 -0
- package/dist/src/tasks/object-detection/data.d.ts.map +1 -0
- package/dist/src/tasks/object-detection/inference.d.ts +63 -0
- package/dist/src/tasks/object-detection/inference.d.ts.map +1 -0
- package/dist/src/tasks/placeholder/data.d.ts +4 -0
- package/dist/src/tasks/placeholder/data.d.ts.map +1 -0
- package/dist/src/tasks/question-answering/data.d.ts +4 -0
- package/dist/src/tasks/question-answering/data.d.ts.map +1 -0
- package/dist/src/tasks/question-answering/inference.d.ts +100 -0
- package/dist/src/tasks/question-answering/inference.d.ts.map +1 -0
- package/dist/src/tasks/reinforcement-learning/data.d.ts +4 -0
- package/dist/src/tasks/reinforcement-learning/data.d.ts.map +1 -0
- package/dist/src/tasks/sentence-similarity/data.d.ts +4 -0
- package/dist/src/tasks/sentence-similarity/data.d.ts.map +1 -0
- package/dist/src/tasks/sentence-similarity/inference.d.ts +32 -0
- package/dist/src/tasks/sentence-similarity/inference.d.ts.map +1 -0
- package/dist/src/tasks/summarization/data.d.ts +4 -0
- package/dist/src/tasks/summarization/data.d.ts.map +1 -0
- package/dist/src/tasks/summarization/inference.d.ts +55 -0
- package/dist/src/tasks/summarization/inference.d.ts.map +1 -0
- package/dist/src/tasks/table-question-answering/data.d.ts +4 -0
- package/dist/src/tasks/table-question-answering/data.d.ts.map +1 -0
- package/dist/src/tasks/table-question-answering/inference.d.ts +62 -0
- package/dist/src/tasks/table-question-answering/inference.d.ts.map +1 -0
- package/dist/src/tasks/tabular-classification/data.d.ts +4 -0
- package/dist/src/tasks/tabular-classification/data.d.ts.map +1 -0
- package/dist/src/tasks/tabular-regression/data.d.ts +4 -0
- package/dist/src/tasks/tabular-regression/data.d.ts.map +1 -0
- package/dist/src/tasks/text-classification/data.d.ts +4 -0
- package/dist/src/tasks/text-classification/data.d.ts.map +1 -0
- package/dist/src/tasks/text-classification/inference.d.ts +52 -0
- package/dist/src/tasks/text-classification/inference.d.ts.map +1 -0
- package/dist/src/tasks/text-generation/data.d.ts +4 -0
- package/dist/src/tasks/text-generation/data.d.ts.map +1 -0
- package/dist/src/tasks/text-generation/inference.d.ts +126 -0
- package/dist/src/tasks/text-generation/inference.d.ts.map +1 -0
- package/dist/src/tasks/text-to-audio/inference.d.ts +139 -0
- package/dist/src/tasks/text-to-audio/inference.d.ts.map +1 -0
- package/dist/src/tasks/text-to-image/data.d.ts +4 -0
- package/dist/src/tasks/text-to-image/data.d.ts.map +1 -0
- package/dist/src/tasks/text-to-image/inference.d.ts +68 -0
- package/dist/src/tasks/text-to-image/inference.d.ts.map +1 -0
- package/dist/src/tasks/text-to-speech/data.d.ts +4 -0
- package/dist/src/tasks/text-to-speech/data.d.ts.map +1 -0
- package/dist/src/tasks/text-to-speech/inference.d.ts +143 -0
- package/dist/src/tasks/text-to-speech/inference.d.ts.map +1 -0
- package/dist/src/tasks/text-to-video/data.d.ts +4 -0
- package/dist/src/tasks/text-to-video/data.d.ts.map +1 -0
- package/dist/src/tasks/text2text-generation/inference.d.ts +54 -0
- package/dist/src/tasks/text2text-generation/inference.d.ts.map +1 -0
- package/dist/src/tasks/token-classification/data.d.ts +4 -0
- package/dist/src/tasks/token-classification/data.d.ts.map +1 -0
- package/dist/src/tasks/token-classification/inference.d.ts +83 -0
- package/dist/src/tasks/token-classification/inference.d.ts.map +1 -0
- package/dist/src/tasks/translation/data.d.ts +4 -0
- package/dist/src/tasks/translation/data.d.ts.map +1 -0
- package/dist/src/tasks/translation/inference.d.ts +55 -0
- package/dist/src/tasks/translation/inference.d.ts.map +1 -0
- package/dist/src/tasks/unconditional-image-generation/data.d.ts +4 -0
- package/dist/src/tasks/unconditional-image-generation/data.d.ts.map +1 -0
- package/dist/src/tasks/video-classification/data.d.ts +4 -0
- package/dist/src/tasks/video-classification/data.d.ts.map +1 -0
- package/dist/src/tasks/video-classification/inference.d.ts +60 -0
- package/dist/src/tasks/video-classification/inference.d.ts.map +1 -0
- package/dist/src/tasks/visual-question-answering/data.d.ts +4 -0
- package/dist/src/tasks/visual-question-answering/data.d.ts.map +1 -0
- package/dist/src/tasks/visual-question-answering/inference.d.ts +64 -0
- package/dist/src/tasks/visual-question-answering/inference.d.ts.map +1 -0
- package/dist/src/tasks/zero-shot-classification/data.d.ts +4 -0
- package/dist/src/tasks/zero-shot-classification/data.d.ts.map +1 -0
- package/dist/src/tasks/zero-shot-classification/inference.d.ts +68 -0
- package/dist/src/tasks/zero-shot-classification/inference.d.ts.map +1 -0
- package/dist/src/tasks/zero-shot-image-classification/data.d.ts +4 -0
- package/dist/src/tasks/zero-shot-image-classification/data.d.ts.map +1 -0
- package/dist/src/tasks/zero-shot-image-classification/inference.d.ts +62 -0
- package/dist/src/tasks/zero-shot-image-classification/inference.d.ts.map +1 -0
- package/dist/src/tasks/zero-shot-object-detection/data.d.ts +4 -0
- package/dist/src/tasks/zero-shot-object-detection/data.d.ts.map +1 -0
- package/dist/src/tasks/zero-shot-object-detection/inference.d.ts +67 -0
- package/dist/src/tasks/zero-shot-object-detection/inference.d.ts.map +1 -0
- package/dist/src/tokenizer-data.d.ts +26 -0
- package/dist/src/tokenizer-data.d.ts.map +1 -0
- package/dist/src/widget-example.d.ts +86 -0
- package/dist/src/widget-example.d.ts.map +1 -0
- package/package.json +11 -6
- package/src/index.ts +3 -0
- package/src/local-apps.ts +119 -0
- package/src/model-data.ts +1 -5
- package/src/model-libraries-snippets.ts +21 -18
- package/src/model-libraries.ts +9 -0
- package/src/tasks/chat-completion/inference.ts +204 -85
- package/src/tasks/chat-completion/spec/input.json +198 -34
- package/src/tasks/chat-completion/spec/output.json +178 -40
- package/src/tasks/chat-completion/spec/stream_output.json +170 -0
- package/src/tasks/index.ts +7 -8
- package/src/tasks/text-generation/inference.ts +58 -170
- package/src/tasks/text-generation/spec/input.json +130 -29
- package/src/tasks/text-generation/spec/output.json +104 -90
- package/src/tasks/text-generation/spec/stream_output.json +97 -0
- package/tsconfig.json +3 -1
- package/dist/index.d.ts +0 -3531
- package/src/tasks/chat-completion/spec/output_stream.json +0 -48
- package/src/tasks/text-generation/spec/output_stream.json +0 -47
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Inference code generated from the JSON schema spec in ./spec
|
|
3
|
+
*
|
|
4
|
+
* Using src/scripts/inference-codegen
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Inputs for Fill Mask inference
|
|
8
|
+
*/
|
|
9
|
+
export interface FillMaskInput {
|
|
10
|
+
/**
|
|
11
|
+
* The text with masked tokens
|
|
12
|
+
*/
|
|
13
|
+
inputs: string;
|
|
14
|
+
/**
|
|
15
|
+
* Additional inference parameters
|
|
16
|
+
*/
|
|
17
|
+
parameters?: FillMaskParameters;
|
|
18
|
+
[property: string]: unknown;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Additional inference parameters
|
|
22
|
+
*
|
|
23
|
+
* Additional inference parameters for Fill Mask
|
|
24
|
+
*/
|
|
25
|
+
export interface FillMaskParameters {
|
|
26
|
+
/**
|
|
27
|
+
* When passed, the model will limit the scores to the passed targets instead of looking up
|
|
28
|
+
* in the whole vocabulary. If the provided targets are not in the model vocab, they will be
|
|
29
|
+
* tokenized and the first resulting token will be used (with a warning, and that might be
|
|
30
|
+
* slower).
|
|
31
|
+
*/
|
|
32
|
+
targets?: string[];
|
|
33
|
+
/**
|
|
34
|
+
* When passed, overrides the number of predictions to return.
|
|
35
|
+
*/
|
|
36
|
+
top_k?: number;
|
|
37
|
+
[property: string]: unknown;
|
|
38
|
+
}
|
|
39
|
+
export type FillMaskOutput = FillMaskOutputElement[];
|
|
40
|
+
/**
|
|
41
|
+
* Outputs of inference for the Fill Mask task
|
|
42
|
+
*/
|
|
43
|
+
export interface FillMaskOutputElement {
|
|
44
|
+
/**
|
|
45
|
+
* The corresponding probability
|
|
46
|
+
*/
|
|
47
|
+
score: number;
|
|
48
|
+
/**
|
|
49
|
+
* The corresponding input with the mask token prediction.
|
|
50
|
+
*/
|
|
51
|
+
sequence: string;
|
|
52
|
+
/**
|
|
53
|
+
* The predicted token id (to replace the masked one).
|
|
54
|
+
*/
|
|
55
|
+
token: number;
|
|
56
|
+
tokenStr: unknown;
|
|
57
|
+
/**
|
|
58
|
+
* The predicted token (to replace the masked one).
|
|
59
|
+
*/
|
|
60
|
+
token_str?: string;
|
|
61
|
+
[property: string]: unknown;
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=inference.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inference.d.ts","sourceRoot":"","sources":["../../../../src/tasks/fill-mask/inference.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH;;GAEG;AACH,MAAM,WAAW,aAAa;IAC7B;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,UAAU,CAAC,EAAE,kBAAkB,CAAC;IAChC,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD;;;;GAIG;AACH,MAAM,WAAW,kBAAkB;IAClC;;;;;OAKG;IACH,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD,MAAM,MAAM,cAAc,GAAG,qBAAqB,EAAE,CAAC;AACrD;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACrC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../../../src/tasks/image-classification/data.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,IAAI,CAAC;AAEzC,QAAA,MAAM,QAAQ,EAAE,cAmFf,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Inference code generated from the JSON schema spec in ./spec
|
|
3
|
+
*
|
|
4
|
+
* Using src/scripts/inference-codegen
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Inputs for Image Classification inference
|
|
8
|
+
*/
|
|
9
|
+
export interface ImageClassificationInput {
|
|
10
|
+
/**
|
|
11
|
+
* The input image data
|
|
12
|
+
*/
|
|
13
|
+
inputs: unknown;
|
|
14
|
+
/**
|
|
15
|
+
* Additional inference parameters
|
|
16
|
+
*/
|
|
17
|
+
parameters?: ImageClassificationParameters;
|
|
18
|
+
[property: string]: unknown;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Additional inference parameters
|
|
22
|
+
*
|
|
23
|
+
* Additional inference parameters for Image Classification
|
|
24
|
+
*/
|
|
25
|
+
export interface ImageClassificationParameters {
|
|
26
|
+
function_to_apply?: ClassificationOutputTransform;
|
|
27
|
+
/**
|
|
28
|
+
* When specified, limits the output to the top K most probable classes.
|
|
29
|
+
*/
|
|
30
|
+
top_k?: number;
|
|
31
|
+
[property: string]: unknown;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* The function to apply to the model outputs in order to retrieve the scores.
|
|
35
|
+
*/
|
|
36
|
+
export type ClassificationOutputTransform = "sigmoid" | "softmax" | "none";
|
|
37
|
+
export type ImageClassificationOutput = ImageClassificationOutputElement[];
|
|
38
|
+
/**
|
|
39
|
+
* Outputs of inference for the Image Classification task
|
|
40
|
+
*/
|
|
41
|
+
export interface ImageClassificationOutputElement {
|
|
42
|
+
/**
|
|
43
|
+
* The predicted class label.
|
|
44
|
+
*/
|
|
45
|
+
label: string;
|
|
46
|
+
/**
|
|
47
|
+
* The corresponding probability.
|
|
48
|
+
*/
|
|
49
|
+
score: number;
|
|
50
|
+
[property: string]: unknown;
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=inference.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inference.d.ts","sourceRoot":"","sources":["../../../../src/tasks/image-classification/inference.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACxC;;OAEG;IACH,MAAM,EAAE,OAAO,CAAC;IAChB;;OAEG;IACH,UAAU,CAAC,EAAE,6BAA6B,CAAC;IAC3C,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD;;;;GAIG;AACH,MAAM,WAAW,6BAA6B;IAC7C,iBAAiB,CAAC,EAAE,6BAA6B,CAAC;IAClD;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD;;GAEG;AACH,MAAM,MAAM,6BAA6B,GAAG,SAAS,GAAG,SAAS,GAAG,MAAM,CAAC;AAC3E,MAAM,MAAM,yBAAyB,GAAG,gCAAgC,EAAE,CAAC;AAC3E;;GAEG;AACH,MAAM,WAAW,gCAAgC;IAChD;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../../../src/tasks/image-feature-extraction/data.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,IAAI,CAAC;AAEzC,QAAA,MAAM,QAAQ,EAAE,cA8Cf,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../../../src/tasks/image-segmentation/data.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,IAAI,CAAC;AAEzC,QAAA,MAAM,QAAQ,EAAE,cA8Ff,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Inference code generated from the JSON schema spec in ./spec
|
|
3
|
+
*
|
|
4
|
+
* Using src/scripts/inference-codegen
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Inputs for Image Segmentation inference
|
|
8
|
+
*/
|
|
9
|
+
export interface ImageSegmentationInput {
|
|
10
|
+
/**
|
|
11
|
+
* The input image data
|
|
12
|
+
*/
|
|
13
|
+
inputs: unknown;
|
|
14
|
+
/**
|
|
15
|
+
* Additional inference parameters
|
|
16
|
+
*/
|
|
17
|
+
parameters?: ImageSegmentationParameters;
|
|
18
|
+
[property: string]: unknown;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Additional inference parameters
|
|
22
|
+
*
|
|
23
|
+
* Additional inference parameters for Image Segmentation
|
|
24
|
+
*/
|
|
25
|
+
export interface ImageSegmentationParameters {
|
|
26
|
+
/**
|
|
27
|
+
* Threshold to use when turning the predicted masks into binary values.
|
|
28
|
+
*/
|
|
29
|
+
mask_threshold?: number;
|
|
30
|
+
/**
|
|
31
|
+
* Mask overlap threshold to eliminate small, disconnected segments.
|
|
32
|
+
*/
|
|
33
|
+
overlap_mask_area_threshold?: number;
|
|
34
|
+
/**
|
|
35
|
+
* Segmentation task to be performed, depending on model capabilities.
|
|
36
|
+
*/
|
|
37
|
+
subtask?: ImageSegmentationSubtask;
|
|
38
|
+
/**
|
|
39
|
+
* Probability threshold to filter out predicted masks.
|
|
40
|
+
*/
|
|
41
|
+
threshold?: number;
|
|
42
|
+
[property: string]: unknown;
|
|
43
|
+
}
|
|
44
|
+
export type ImageSegmentationSubtask = "instance" | "panoptic" | "semantic";
|
|
45
|
+
export type ImageSegmentationOutput = ImageSegmentationOutputElement[];
|
|
46
|
+
/**
|
|
47
|
+
* Outputs of inference for the Image Segmentation task
|
|
48
|
+
*
|
|
49
|
+
* A predicted mask / segment
|
|
50
|
+
*/
|
|
51
|
+
export interface ImageSegmentationOutputElement {
|
|
52
|
+
/**
|
|
53
|
+
* The label of the predicted segment
|
|
54
|
+
*/
|
|
55
|
+
label: string;
|
|
56
|
+
/**
|
|
57
|
+
* The corresponding mask as a black-and-white image
|
|
58
|
+
*/
|
|
59
|
+
mask: unknown;
|
|
60
|
+
/**
|
|
61
|
+
* The score or confidence degreee the model has
|
|
62
|
+
*/
|
|
63
|
+
score?: number;
|
|
64
|
+
[property: string]: unknown;
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=inference.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inference.d.ts","sourceRoot":"","sources":["../../../../src/tasks/image-segmentation/inference.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACtC;;OAEG;IACH,MAAM,EAAE,OAAO,CAAC;IAChB;;OAEG;IACH,UAAU,CAAC,EAAE,2BAA2B,CAAC;IACzC,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD;;;;GAIG;AACH,MAAM,WAAW,2BAA2B;IAC3C;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;OAEG;IACH,2BAA2B,CAAC,EAAE,MAAM,CAAC;IACrC;;OAEG;IACH,OAAO,CAAC,EAAE,wBAAwB,CAAC;IACnC;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD,MAAM,MAAM,wBAAwB,GAAG,UAAU,GAAG,UAAU,GAAG,UAAU,CAAC;AAC5E,MAAM,MAAM,uBAAuB,GAAG,8BAA8B,EAAE,CAAC;AACvE;;;;GAIG;AACH,MAAM,WAAW,8BAA8B;IAC9C;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,IAAI,EAAE,OAAO,CAAC;IACd;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../../../src/tasks/image-to-image/data.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,IAAI,CAAC;AAEzC,QAAA,MAAM,QAAQ,EAAE,cAgGf,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Inference code generated from the JSON schema spec in ./spec
|
|
3
|
+
*
|
|
4
|
+
* Using src/scripts/inference-codegen
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Inputs for Image To Image inference
|
|
8
|
+
*/
|
|
9
|
+
export interface ImageToImageInput {
|
|
10
|
+
/**
|
|
11
|
+
* The input image data
|
|
12
|
+
*/
|
|
13
|
+
inputs: unknown;
|
|
14
|
+
/**
|
|
15
|
+
* Additional inference parameters
|
|
16
|
+
*/
|
|
17
|
+
parameters?: ImageToImageParameters;
|
|
18
|
+
[property: string]: unknown;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Additional inference parameters
|
|
22
|
+
*
|
|
23
|
+
* Additional inference parameters for Image To Image
|
|
24
|
+
*/
|
|
25
|
+
export interface ImageToImageParameters {
|
|
26
|
+
/**
|
|
27
|
+
* For diffusion models. A higher guidance scale value encourages the model to generate
|
|
28
|
+
* images closely linked to the text prompt at the expense of lower image quality.
|
|
29
|
+
*/
|
|
30
|
+
guidance_scale?: number;
|
|
31
|
+
/**
|
|
32
|
+
* One or several prompt to guide what NOT to include in image generation.
|
|
33
|
+
*/
|
|
34
|
+
negative_prompt?: string[];
|
|
35
|
+
/**
|
|
36
|
+
* For diffusion models. The number of denoising steps. More denoising steps usually lead to
|
|
37
|
+
* a higher quality image at the expense of slower inference.
|
|
38
|
+
*/
|
|
39
|
+
num_inference_steps?: number;
|
|
40
|
+
/**
|
|
41
|
+
* The size in pixel of the output image
|
|
42
|
+
*/
|
|
43
|
+
target_size?: TargetSize;
|
|
44
|
+
[property: string]: unknown;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* The size in pixel of the output image
|
|
48
|
+
*/
|
|
49
|
+
export interface TargetSize {
|
|
50
|
+
height: number;
|
|
51
|
+
width: number;
|
|
52
|
+
[property: string]: unknown;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Outputs of inference for the Image To Image task
|
|
56
|
+
*/
|
|
57
|
+
export interface ImageToImageOutput {
|
|
58
|
+
/**
|
|
59
|
+
* The output image
|
|
60
|
+
*/
|
|
61
|
+
image?: unknown;
|
|
62
|
+
[property: string]: unknown;
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=inference.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inference.d.ts","sourceRoot":"","sources":["../../../../src/tasks/image-to-image/inference.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,MAAM,WAAW,iBAAiB;IACjC;;OAEG;IACH,MAAM,EAAE,OAAO,CAAC;IAChB;;OAEG;IACH,UAAU,CAAC,EAAE,sBAAsB,CAAC;IACpC,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AAED;;;;GAIG;AACH,MAAM,WAAW,sBAAsB;IACtC;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAC3B;;;OAGG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B;;OAEG;IACH,WAAW,CAAC,EAAE,UAAU,CAAC;IACzB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IAClC;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../../../src/tasks/image-to-text/data.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,IAAI,CAAC;AAEzC,QAAA,MAAM,QAAQ,EAAE,cA6Ef,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Inference code generated from the JSON schema spec in ./spec
|
|
3
|
+
*
|
|
4
|
+
* Using src/scripts/inference-codegen
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Inputs for Image To Text inference
|
|
8
|
+
*/
|
|
9
|
+
export interface ImageToTextInput {
|
|
10
|
+
/**
|
|
11
|
+
* The input image data
|
|
12
|
+
*/
|
|
13
|
+
inputs: unknown;
|
|
14
|
+
/**
|
|
15
|
+
* Additional inference parameters
|
|
16
|
+
*/
|
|
17
|
+
parameters?: ImageToTextParameters;
|
|
18
|
+
[property: string]: unknown;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Additional inference parameters
|
|
22
|
+
*
|
|
23
|
+
* Additional inference parameters for Image To Text
|
|
24
|
+
*/
|
|
25
|
+
export interface ImageToTextParameters {
|
|
26
|
+
/**
|
|
27
|
+
* Parametrization of the text generation process
|
|
28
|
+
*/
|
|
29
|
+
generate?: GenerationParameters;
|
|
30
|
+
/**
|
|
31
|
+
* The amount of maximum tokens to generate.
|
|
32
|
+
*/
|
|
33
|
+
max_new_tokens?: number;
|
|
34
|
+
[property: string]: unknown;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Parametrization of the text generation process
|
|
38
|
+
*
|
|
39
|
+
* Ad-hoc parametrization of the text generation process
|
|
40
|
+
*/
|
|
41
|
+
export interface GenerationParameters {
|
|
42
|
+
/**
|
|
43
|
+
* Whether to use sampling instead of greedy decoding when generating new tokens.
|
|
44
|
+
*/
|
|
45
|
+
do_sample?: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Controls the stopping condition for beam-based methods.
|
|
48
|
+
*/
|
|
49
|
+
early_stopping?: EarlyStoppingUnion;
|
|
50
|
+
/**
|
|
51
|
+
* If set to float strictly between 0 and 1, only tokens with a conditional probability
|
|
52
|
+
* greater than epsilon_cutoff will be sampled. In the paper, suggested values range from
|
|
53
|
+
* 3e-4 to 9e-4, depending on the size of the model. See [Truncation Sampling as Language
|
|
54
|
+
* Model Desmoothing](https://hf.co/papers/2210.15191) for more details.
|
|
55
|
+
*/
|
|
56
|
+
epsilon_cutoff?: number;
|
|
57
|
+
/**
|
|
58
|
+
* Eta sampling is a hybrid of locally typical sampling and epsilon sampling. If set to
|
|
59
|
+
* float strictly between 0 and 1, a token is only considered if it is greater than either
|
|
60
|
+
* eta_cutoff or sqrt(eta_cutoff) * exp(-entropy(softmax(next_token_logits))). The latter
|
|
61
|
+
* term is intuitively the expected next token probability, scaled by sqrt(eta_cutoff). In
|
|
62
|
+
* the paper, suggested values range from 3e-4 to 2e-3, depending on the size of the model.
|
|
63
|
+
* See [Truncation Sampling as Language Model Desmoothing](https://hf.co/papers/2210.15191)
|
|
64
|
+
* for more details.
|
|
65
|
+
*/
|
|
66
|
+
eta_cutoff?: number;
|
|
67
|
+
/**
|
|
68
|
+
* The maximum length (in tokens) of the generated text, including the input.
|
|
69
|
+
*/
|
|
70
|
+
max_length?: number;
|
|
71
|
+
/**
|
|
72
|
+
* The maximum number of tokens to generate. Takes precedence over maxLength.
|
|
73
|
+
*/
|
|
74
|
+
max_new_tokens?: number;
|
|
75
|
+
/**
|
|
76
|
+
* The minimum length (in tokens) of the generated text, including the input.
|
|
77
|
+
*/
|
|
78
|
+
min_length?: number;
|
|
79
|
+
/**
|
|
80
|
+
* The minimum number of tokens to generate. Takes precedence over maxLength.
|
|
81
|
+
*/
|
|
82
|
+
min_new_tokens?: number;
|
|
83
|
+
/**
|
|
84
|
+
* Number of groups to divide num_beams into in order to ensure diversity among different
|
|
85
|
+
* groups of beams. See [this paper](https://hf.co/papers/1610.02424) for more details.
|
|
86
|
+
*/
|
|
87
|
+
num_beam_groups?: number;
|
|
88
|
+
/**
|
|
89
|
+
* Number of beams to use for beam search.
|
|
90
|
+
*/
|
|
91
|
+
num_beams?: number;
|
|
92
|
+
/**
|
|
93
|
+
* The value balances the model confidence and the degeneration penalty in contrastive
|
|
94
|
+
* search decoding.
|
|
95
|
+
*/
|
|
96
|
+
penalty_alpha?: number;
|
|
97
|
+
/**
|
|
98
|
+
* The value used to modulate the next token probabilities.
|
|
99
|
+
*/
|
|
100
|
+
temperature?: number;
|
|
101
|
+
/**
|
|
102
|
+
* The number of highest probability vocabulary tokens to keep for top-k-filtering.
|
|
103
|
+
*/
|
|
104
|
+
top_k?: number;
|
|
105
|
+
/**
|
|
106
|
+
* If set to float < 1, only the smallest set of most probable tokens with probabilities
|
|
107
|
+
* that add up to top_p or higher are kept for generation.
|
|
108
|
+
*/
|
|
109
|
+
top_p?: number;
|
|
110
|
+
/**
|
|
111
|
+
* Local typicality measures how similar the conditional probability of predicting a target
|
|
112
|
+
* token next is to the expected conditional probability of predicting a random token next,
|
|
113
|
+
* given the partial text already generated. If set to float < 1, the smallest set of the
|
|
114
|
+
* most locally typical tokens with probabilities that add up to typical_p or higher are
|
|
115
|
+
* kept for generation. See [this paper](https://hf.co/papers/2202.00666) for more details.
|
|
116
|
+
*/
|
|
117
|
+
typical_p?: number;
|
|
118
|
+
/**
|
|
119
|
+
* Whether the model should use the past last key/values attentions to speed up decoding
|
|
120
|
+
*/
|
|
121
|
+
use_cache?: boolean;
|
|
122
|
+
[property: string]: unknown;
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Controls the stopping condition for beam-based methods.
|
|
126
|
+
*/
|
|
127
|
+
export type EarlyStoppingUnion = boolean | "never";
|
|
128
|
+
/**
|
|
129
|
+
* Outputs of inference for the Image To Text task
|
|
130
|
+
*/
|
|
131
|
+
export interface ImageToTextOutput {
|
|
132
|
+
generatedText: unknown;
|
|
133
|
+
/**
|
|
134
|
+
* The generated text.
|
|
135
|
+
*/
|
|
136
|
+
generated_text?: string;
|
|
137
|
+
[property: string]: unknown;
|
|
138
|
+
}
|
|
139
|
+
//# sourceMappingURL=inference.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inference.d.ts","sourceRoot":"","sources":["../../../../src/tasks/image-to-text/inference.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAChC;;OAEG;IACH,MAAM,EAAE,OAAO,CAAC;IAChB;;OAEG;IACH,UAAU,CAAC,EAAE,qBAAqB,CAAC;IACnC,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AAED;;;;GAIG;AACH,MAAM,WAAW,qBAAqB;IACrC;;OAEG;IACH,QAAQ,CAAC,EAAE,oBAAoB,CAAC;IAChC;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AAED;;;;GAIG;AACH,MAAM,WAAW,oBAAoB;IACpC;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,cAAc,CAAC,EAAE,kBAAkB,CAAC;IACpC;;;;;OAKG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;;;;;;;OAQG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;;;OAMG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AAED;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,OAAO,GAAG,OAAO,CAAC;AAEnD;;GAEG;AACH,MAAM,WAAW,iBAAiB;IACjC,aAAa,EAAE,OAAO,CAAC;IACvB;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import type { PipelineType } from "../pipelines";
|
|
2
|
+
export type * from "./audio-classification/inference";
|
|
3
|
+
export type * from "./automatic-speech-recognition/inference";
|
|
4
|
+
export type { ChatCompletionInput, ChatCompletionInputMessage, ChatCompletionOutput, ChatCompletionOutputComplete, ChatCompletionOutputMessage, ChatCompletionStreamOutput, ChatCompletionStreamOutputChoice, ChatCompletionStreamOutputDelta, } from "./chat-completion/inference";
|
|
5
|
+
export type * from "./document-question-answering/inference";
|
|
6
|
+
export type * from "./feature-extraction/inference";
|
|
7
|
+
export type * from "./fill-mask/inference";
|
|
8
|
+
export type { ImageClassificationInput, ImageClassificationOutput, ImageClassificationOutputElement, ImageClassificationParameters, } from "./image-classification/inference";
|
|
9
|
+
export type * from "./image-to-image/inference";
|
|
10
|
+
export type { ImageToTextInput, ImageToTextOutput, ImageToTextParameters } from "./image-to-text/inference";
|
|
11
|
+
export type * from "./image-segmentation/inference";
|
|
12
|
+
export type * from "./object-detection/inference";
|
|
13
|
+
export type * from "./depth-estimation/inference";
|
|
14
|
+
export type * from "./question-answering/inference";
|
|
15
|
+
export type * from "./sentence-similarity/inference";
|
|
16
|
+
export type * from "./summarization/inference";
|
|
17
|
+
export type * from "./table-question-answering/inference";
|
|
18
|
+
export type { TextToImageInput, TextToImageOutput, TextToImageParameters } from "./text-to-image/inference";
|
|
19
|
+
export type { TextToAudioParameters, TextToSpeechInput, TextToSpeechOutput } from "./text-to-speech/inference";
|
|
20
|
+
export type * from "./token-classification/inference";
|
|
21
|
+
export type { Text2TextGenerationParameters, Text2TextGenerationTruncationStrategy, TranslationInput, TranslationOutput, } from "./translation/inference";
|
|
22
|
+
export type { ClassificationOutputTransform, TextClassificationInput, TextClassificationOutput, TextClassificationOutputElement, TextClassificationParameters, } from "./text-classification/inference";
|
|
23
|
+
export type { TextGenerationOutputFinishReason, TextGenerationOutputPrefillToken, TextGenerationInput, TextGenerationOutput, TextGenerationOutputDetails, TextGenerationInputGenerateParameters, TextGenerationOutputBestOfSequence, TextGenerationOutputToken, TextGenerationStreamOutputStreamDetails, TextGenerationStreamOutput, } from "./text-generation/inference";
|
|
24
|
+
export type * from "./video-classification/inference";
|
|
25
|
+
export type * from "./visual-question-answering/inference";
|
|
26
|
+
export type * from "./zero-shot-classification/inference";
|
|
27
|
+
export type * from "./zero-shot-image-classification/inference";
|
|
28
|
+
export type { BoundingBox, ZeroShotObjectDetectionInput, ZeroShotObjectDetectionInputData, ZeroShotObjectDetectionOutput, ZeroShotObjectDetectionOutputElement, } from "./zero-shot-object-detection/inference";
|
|
29
|
+
import type { ModelLibraryKey } from "../model-libraries";
|
|
30
|
+
/**
|
|
31
|
+
* Model libraries compatible with each ML task
|
|
32
|
+
*/
|
|
33
|
+
export declare const TASKS_MODEL_LIBRARIES: Record<PipelineType, ModelLibraryKey[]>;
|
|
34
|
+
export declare const TASKS_DATA: Record<PipelineType, TaskData | undefined>;
|
|
35
|
+
export interface ExampleRepo {
|
|
36
|
+
description: string;
|
|
37
|
+
id: string;
|
|
38
|
+
}
|
|
39
|
+
export type TaskDemoEntry = {
|
|
40
|
+
filename: string;
|
|
41
|
+
type: "audio";
|
|
42
|
+
} | {
|
|
43
|
+
data: Array<{
|
|
44
|
+
label: string;
|
|
45
|
+
score: number;
|
|
46
|
+
}>;
|
|
47
|
+
type: "chart";
|
|
48
|
+
} | {
|
|
49
|
+
filename: string;
|
|
50
|
+
type: "img";
|
|
51
|
+
} | {
|
|
52
|
+
table: string[][];
|
|
53
|
+
type: "tabular";
|
|
54
|
+
} | {
|
|
55
|
+
content: string;
|
|
56
|
+
label: string;
|
|
57
|
+
type: "text";
|
|
58
|
+
} | {
|
|
59
|
+
text: string;
|
|
60
|
+
tokens: Array<{
|
|
61
|
+
end: number;
|
|
62
|
+
start: number;
|
|
63
|
+
type: string;
|
|
64
|
+
}>;
|
|
65
|
+
type: "text-with-tokens";
|
|
66
|
+
};
|
|
67
|
+
export interface TaskDemo {
|
|
68
|
+
inputs: TaskDemoEntry[];
|
|
69
|
+
outputs: TaskDemoEntry[];
|
|
70
|
+
}
|
|
71
|
+
export interface TaskData {
|
|
72
|
+
datasets: ExampleRepo[];
|
|
73
|
+
demo: TaskDemo;
|
|
74
|
+
id: PipelineType;
|
|
75
|
+
canonicalId?: PipelineType;
|
|
76
|
+
isPlaceholder?: boolean;
|
|
77
|
+
label: string;
|
|
78
|
+
libraries: ModelLibraryKey[];
|
|
79
|
+
metrics: ExampleRepo[];
|
|
80
|
+
models: ExampleRepo[];
|
|
81
|
+
spaces: ExampleRepo[];
|
|
82
|
+
summary: string;
|
|
83
|
+
widgetModels: string[];
|
|
84
|
+
youtubeId?: string;
|
|
85
|
+
}
|
|
86
|
+
export type TaskDataCustom = Omit<TaskData, "id" | "label" | "libraries">;
|
|
87
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tasks/index.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../../../src/tasks/mask-generation/data.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,IAAI,CAAC;AAEzC,QAAA,MAAM,QAAQ,EAAE,cAkDf,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../../../src/tasks/object-detection/data.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,IAAI,CAAC;AAEzC,QAAA,MAAM,QAAQ,EAAE,cA0Ef,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Inference code generated from the JSON schema spec in ./spec
|
|
3
|
+
*
|
|
4
|
+
* Using src/scripts/inference-codegen
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Inputs for Object Detection inference
|
|
8
|
+
*/
|
|
9
|
+
export interface ObjectDetectionInput {
|
|
10
|
+
/**
|
|
11
|
+
* The input image data
|
|
12
|
+
*/
|
|
13
|
+
inputs: unknown;
|
|
14
|
+
/**
|
|
15
|
+
* Additional inference parameters
|
|
16
|
+
*/
|
|
17
|
+
parameters?: ObjectDetectionParameters;
|
|
18
|
+
[property: string]: unknown;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Additional inference parameters
|
|
22
|
+
*
|
|
23
|
+
* Additional inference parameters for Object Detection
|
|
24
|
+
*/
|
|
25
|
+
export interface ObjectDetectionParameters {
|
|
26
|
+
/**
|
|
27
|
+
* The probability necessary to make a prediction.
|
|
28
|
+
*/
|
|
29
|
+
threshold?: number;
|
|
30
|
+
[property: string]: unknown;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* The predicted bounding box. Coordinates are relative to the top left corner of the input
|
|
34
|
+
* image.
|
|
35
|
+
*/
|
|
36
|
+
export interface BoundingBox {
|
|
37
|
+
xmax: number;
|
|
38
|
+
xmin: number;
|
|
39
|
+
ymax: number;
|
|
40
|
+
ymin: number;
|
|
41
|
+
[property: string]: unknown;
|
|
42
|
+
}
|
|
43
|
+
export type ObjectDetectionOutput = ObjectDetectionOutputElement[];
|
|
44
|
+
/**
|
|
45
|
+
* Outputs of inference for the Object Detection task
|
|
46
|
+
*/
|
|
47
|
+
export interface ObjectDetectionOutputElement {
|
|
48
|
+
/**
|
|
49
|
+
* The predicted bounding box. Coordinates are relative to the top left corner of the input
|
|
50
|
+
* image.
|
|
51
|
+
*/
|
|
52
|
+
box: BoundingBox;
|
|
53
|
+
/**
|
|
54
|
+
* The predicted label for the bounding box
|
|
55
|
+
*/
|
|
56
|
+
label: string;
|
|
57
|
+
/**
|
|
58
|
+
* The associated score / probability
|
|
59
|
+
*/
|
|
60
|
+
score: number;
|
|
61
|
+
[property: string]: unknown;
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=inference.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inference.d.ts","sourceRoot":"","sources":["../../../../src/tasks/object-detection/inference.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACpC;;OAEG;IACH,MAAM,EAAE,OAAO,CAAC;IAChB;;OAEG;IACH,UAAU,CAAC,EAAE,yBAAyB,CAAC;IACvC,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD;;;;GAIG;AACH,MAAM,WAAW,yBAAyB;IACzC;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD;;;GAGG;AACH,MAAM,WAAW,WAAW;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD,MAAM,MAAM,qBAAqB,GAAG,4BAA4B,EAAE,CAAC;AACnE;;GAEG;AACH,MAAM,WAAW,4BAA4B;IAC5C;;;OAGG;IACH,GAAG,EAAE,WAAW,CAAC;IACjB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../../../src/tasks/placeholder/data.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,IAAI,CAAC;AAEzC,QAAA,MAAM,QAAQ,EAAE,cAgBf,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../../../src/tasks/question-answering/data.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,IAAI,CAAC;AAEzC,QAAA,MAAM,QAAQ,EAAE,cAkEf,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|