@huggingface/tasks 0.13.2 → 0.13.4
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/dist/commonjs/index.d.ts +1 -0
- package/dist/commonjs/index.d.ts.map +1 -1
- package/dist/commonjs/model-libraries.d.ts +8 -1
- package/dist/commonjs/model-libraries.d.ts.map +1 -1
- package/dist/commonjs/model-libraries.js +7 -0
- package/dist/commonjs/pipelines.d.ts +7 -1
- package/dist/commonjs/pipelines.d.ts.map +1 -1
- package/dist/commonjs/pipelines.js +6 -0
- package/dist/commonjs/tasks/automatic-speech-recognition/data.d.ts.map +1 -1
- package/dist/commonjs/tasks/automatic-speech-recognition/data.js +15 -3
- package/dist/commonjs/tasks/document-question-answering/inference.d.ts +0 -4
- package/dist/commonjs/tasks/document-question-answering/inference.d.ts.map +1 -1
- package/dist/commonjs/tasks/index.d.ts +1 -1
- package/dist/commonjs/tasks/index.d.ts.map +1 -1
- package/dist/commonjs/tasks/index.js +2 -0
- package/dist/commonjs/tasks/mask-generation/data.d.ts.map +1 -1
- package/dist/commonjs/tasks/mask-generation/data.js +16 -2
- package/dist/commonjs/tasks/text-to-speech/data.d.ts.map +1 -1
- package/dist/commonjs/tasks/text-to-speech/data.js +15 -7
- package/dist/commonjs/tasks/zero-shot-classification/inference.d.ts +9 -19
- package/dist/commonjs/tasks/zero-shot-classification/inference.d.ts.map +1 -1
- package/dist/commonjs/tasks/zero-shot-image-classification/inference.d.ts +9 -19
- package/dist/commonjs/tasks/zero-shot-image-classification/inference.d.ts.map +1 -1
- package/dist/commonjs/tasks/zero-shot-object-detection/inference.d.ts +8 -12
- package/dist/commonjs/tasks/zero-shot-object-detection/inference.d.ts.map +1 -1
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/model-libraries.d.ts +8 -1
- package/dist/esm/model-libraries.d.ts.map +1 -1
- package/dist/esm/model-libraries.js +7 -0
- package/dist/esm/pipelines.d.ts +7 -1
- package/dist/esm/pipelines.d.ts.map +1 -1
- package/dist/esm/pipelines.js +6 -0
- package/dist/esm/tasks/automatic-speech-recognition/data.d.ts.map +1 -1
- package/dist/esm/tasks/automatic-speech-recognition/data.js +15 -3
- package/dist/esm/tasks/document-question-answering/inference.d.ts +0 -4
- package/dist/esm/tasks/document-question-answering/inference.d.ts.map +1 -1
- package/dist/esm/tasks/index.d.ts +1 -1
- package/dist/esm/tasks/index.d.ts.map +1 -1
- package/dist/esm/tasks/index.js +2 -0
- package/dist/esm/tasks/mask-generation/data.d.ts.map +1 -1
- package/dist/esm/tasks/mask-generation/data.js +16 -2
- package/dist/esm/tasks/text-to-speech/data.d.ts.map +1 -1
- package/dist/esm/tasks/text-to-speech/data.js +15 -7
- package/dist/esm/tasks/zero-shot-classification/inference.d.ts +9 -19
- package/dist/esm/tasks/zero-shot-classification/inference.d.ts.map +1 -1
- package/dist/esm/tasks/zero-shot-image-classification/inference.d.ts +9 -19
- package/dist/esm/tasks/zero-shot-image-classification/inference.d.ts.map +1 -1
- package/dist/esm/tasks/zero-shot-object-detection/inference.d.ts +8 -12
- package/dist/esm/tasks/zero-shot-object-detection/inference.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +1 -0
- package/src/model-libraries.ts +7 -0
- package/src/pipelines.ts +6 -0
- package/src/tasks/automatic-speech-recognition/data.ts +15 -3
- package/src/tasks/document-question-answering/inference.ts +0 -4
- package/src/tasks/document-question-answering/spec/output.json +1 -8
- package/src/tasks/index.ts +2 -1
- package/src/tasks/mask-generation/about.md +10 -0
- package/src/tasks/mask-generation/data.ts +16 -2
- package/src/tasks/text-to-speech/data.ts +15 -7
- package/src/tasks/zero-shot-classification/inference.ts +9 -19
- package/src/tasks/zero-shot-classification/spec/input.json +13 -20
- package/src/tasks/zero-shot-image-classification/inference.ts +9 -19
- package/src/tasks/zero-shot-image-classification/spec/input.json +13 -19
- package/src/tasks/zero-shot-object-detection/inference.ts +8 -12
- package/src/tasks/zero-shot-object-detection/spec/input.json +13 -18
|
@@ -8,27 +8,13 @@
|
|
|
8
8
|
*/
|
|
9
9
|
export interface ZeroShotClassificationInput {
|
|
10
10
|
/**
|
|
11
|
-
* The
|
|
11
|
+
* The text to classify
|
|
12
12
|
*/
|
|
13
|
-
inputs:
|
|
13
|
+
inputs: string;
|
|
14
14
|
/**
|
|
15
15
|
* Additional inference parameters
|
|
16
16
|
*/
|
|
17
|
-
parameters
|
|
18
|
-
[property: string]: unknown;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* The input text data, with candidate labels
|
|
22
|
-
*/
|
|
23
|
-
export interface ZeroShotClassificationInputData {
|
|
24
|
-
/**
|
|
25
|
-
* The set of possible class labels to classify the text into.
|
|
26
|
-
*/
|
|
27
|
-
candidateLabels: string[];
|
|
28
|
-
/**
|
|
29
|
-
* The text to classify
|
|
30
|
-
*/
|
|
31
|
-
text: string;
|
|
17
|
+
parameters: ZeroShotClassificationParameters;
|
|
32
18
|
[property: string]: unknown;
|
|
33
19
|
}
|
|
34
20
|
/**
|
|
@@ -38,8 +24,12 @@ export interface ZeroShotClassificationInputData {
|
|
|
38
24
|
*/
|
|
39
25
|
export interface ZeroShotClassificationParameters {
|
|
40
26
|
/**
|
|
41
|
-
* The
|
|
42
|
-
|
|
27
|
+
* The set of possible class labels to classify the text into.
|
|
28
|
+
*/
|
|
29
|
+
candidate_labels: string[];
|
|
30
|
+
/**
|
|
31
|
+
* The sentence used in conjunction with `candidate_labels` to attempt the text
|
|
32
|
+
* classification by replacing the placeholder with the candidate labels.
|
|
43
33
|
*/
|
|
44
34
|
hypothesis_template?: string;
|
|
45
35
|
/**
|
|
@@ -6,23 +6,8 @@
|
|
|
6
6
|
"type": "object",
|
|
7
7
|
"properties": {
|
|
8
8
|
"inputs": {
|
|
9
|
-
"description": "The
|
|
10
|
-
"type": "
|
|
11
|
-
"title": "ZeroShotClassificationInputData",
|
|
12
|
-
"properties": {
|
|
13
|
-
"text": {
|
|
14
|
-
"type": "string",
|
|
15
|
-
"description": "The text to classify"
|
|
16
|
-
},
|
|
17
|
-
"candidateLabels": {
|
|
18
|
-
"type": "array",
|
|
19
|
-
"description": "The set of possible class labels to classify the text into.",
|
|
20
|
-
"items": {
|
|
21
|
-
"type": "string"
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
},
|
|
25
|
-
"required": ["text", "candidateLabels"]
|
|
9
|
+
"description": "The text to classify",
|
|
10
|
+
"type": "string"
|
|
26
11
|
},
|
|
27
12
|
"parameters": {
|
|
28
13
|
"description": "Additional inference parameters",
|
|
@@ -35,16 +20,24 @@
|
|
|
35
20
|
"description": "Additional inference parameters for Zero Shot Classification",
|
|
36
21
|
"type": "object",
|
|
37
22
|
"properties": {
|
|
23
|
+
"candidate_labels": {
|
|
24
|
+
"type": "array",
|
|
25
|
+
"description": "The set of possible class labels to classify the text into.",
|
|
26
|
+
"items": {
|
|
27
|
+
"type": "string"
|
|
28
|
+
}
|
|
29
|
+
},
|
|
38
30
|
"hypothesis_template": {
|
|
39
31
|
"type": "string",
|
|
40
|
-
"description": "The sentence used in conjunction with
|
|
32
|
+
"description": "The sentence used in conjunction with `candidate_labels` to attempt the text classification by replacing the placeholder with the candidate labels."
|
|
41
33
|
},
|
|
42
34
|
"multi_label": {
|
|
43
35
|
"type": "boolean",
|
|
44
36
|
"description": "Whether multiple candidate labels can be true. If false, the scores are normalized such that the sum of the label likelihoods for each sequence is 1. If true, the labels are considered independent and probabilities are normalized for each candidate."
|
|
45
37
|
}
|
|
46
|
-
}
|
|
38
|
+
},
|
|
39
|
+
"required": ["candidate_labels"]
|
|
47
40
|
}
|
|
48
41
|
},
|
|
49
|
-
"required": ["inputs"]
|
|
42
|
+
"required": ["inputs", "parameters"]
|
|
50
43
|
}
|
|
@@ -8,27 +8,13 @@
|
|
|
8
8
|
*/
|
|
9
9
|
export interface ZeroShotImageClassificationInput {
|
|
10
10
|
/**
|
|
11
|
-
* The input image data
|
|
11
|
+
* The input image data to classify as a base64-encoded string.
|
|
12
12
|
*/
|
|
13
|
-
inputs:
|
|
13
|
+
inputs: string;
|
|
14
14
|
/**
|
|
15
15
|
* Additional inference parameters
|
|
16
16
|
*/
|
|
17
|
-
parameters
|
|
18
|
-
[property: string]: unknown;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* The input image data, with candidate labels
|
|
22
|
-
*/
|
|
23
|
-
export interface ZeroShotImageClassificationInputData {
|
|
24
|
-
/**
|
|
25
|
-
* The candidate labels for this image
|
|
26
|
-
*/
|
|
27
|
-
candidateLabels: string[];
|
|
28
|
-
/**
|
|
29
|
-
* The image data to classify
|
|
30
|
-
*/
|
|
31
|
-
image: unknown;
|
|
17
|
+
parameters: ZeroShotImageClassificationParameters;
|
|
32
18
|
[property: string]: unknown;
|
|
33
19
|
}
|
|
34
20
|
/**
|
|
@@ -38,8 +24,12 @@ export interface ZeroShotImageClassificationInputData {
|
|
|
38
24
|
*/
|
|
39
25
|
export interface ZeroShotImageClassificationParameters {
|
|
40
26
|
/**
|
|
41
|
-
* The
|
|
42
|
-
|
|
27
|
+
* The candidate labels for this image
|
|
28
|
+
*/
|
|
29
|
+
candidate_labels: string[];
|
|
30
|
+
/**
|
|
31
|
+
* The sentence used in conjunction with `candidate_labels` to attempt the image
|
|
32
|
+
* classification by replacing the placeholder with the candidate labels.
|
|
43
33
|
*/
|
|
44
34
|
hypothesis_template?: string;
|
|
45
35
|
[property: string]: unknown;
|
|
@@ -6,22 +6,8 @@
|
|
|
6
6
|
"type": "object",
|
|
7
7
|
"properties": {
|
|
8
8
|
"inputs": {
|
|
9
|
-
"
|
|
10
|
-
"
|
|
11
|
-
"title": "ZeroShotImageClassificationInputData",
|
|
12
|
-
"properties": {
|
|
13
|
-
"image": {
|
|
14
|
-
"description": "The image data to classify"
|
|
15
|
-
},
|
|
16
|
-
"candidateLabels": {
|
|
17
|
-
"description": "The candidate labels for this image",
|
|
18
|
-
"type": "array",
|
|
19
|
-
"items": {
|
|
20
|
-
"type": "string"
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
},
|
|
24
|
-
"required": ["image", "candidateLabels"]
|
|
9
|
+
"type": "string",
|
|
10
|
+
"description": "The input image data to classify as a base64-encoded string."
|
|
25
11
|
},
|
|
26
12
|
"parameters": {
|
|
27
13
|
"description": "Additional inference parameters",
|
|
@@ -34,12 +20,20 @@
|
|
|
34
20
|
"description": "Additional inference parameters for Zero Shot Image Classification",
|
|
35
21
|
"type": "object",
|
|
36
22
|
"properties": {
|
|
23
|
+
"candidate_labels": {
|
|
24
|
+
"description": "The candidate labels for this image",
|
|
25
|
+
"type": "array",
|
|
26
|
+
"items": {
|
|
27
|
+
"type": "string"
|
|
28
|
+
}
|
|
29
|
+
},
|
|
37
30
|
"hypothesis_template": {
|
|
38
31
|
"type": "string",
|
|
39
|
-
"description": "The sentence used in conjunction with
|
|
32
|
+
"description": "The sentence used in conjunction with `candidate_labels` to attempt the image classification by replacing the placeholder with the candidate labels."
|
|
40
33
|
}
|
|
41
|
-
}
|
|
34
|
+
},
|
|
35
|
+
"required": ["candidate_labels"]
|
|
42
36
|
}
|
|
43
37
|
},
|
|
44
|
-
"required": ["inputs"]
|
|
38
|
+
"required": ["inputs", "parameters"]
|
|
45
39
|
}
|
|
@@ -8,29 +8,25 @@
|
|
|
8
8
|
*/
|
|
9
9
|
export interface ZeroShotObjectDetectionInput {
|
|
10
10
|
/**
|
|
11
|
-
* The input image data
|
|
11
|
+
* The input image data as a base64-encoded string.
|
|
12
12
|
*/
|
|
13
|
-
inputs:
|
|
13
|
+
inputs: string;
|
|
14
14
|
/**
|
|
15
15
|
* Additional inference parameters
|
|
16
16
|
*/
|
|
17
|
-
parameters
|
|
18
|
-
[key: string]: unknown;
|
|
19
|
-
};
|
|
17
|
+
parameters: ZeroShotObjectDetectionParameters;
|
|
20
18
|
[property: string]: unknown;
|
|
21
19
|
}
|
|
22
20
|
/**
|
|
23
|
-
*
|
|
21
|
+
* Additional inference parameters
|
|
22
|
+
*
|
|
23
|
+
* Additional inference parameters for Zero Shot Object Detection
|
|
24
24
|
*/
|
|
25
|
-
export interface
|
|
25
|
+
export interface ZeroShotObjectDetectionParameters {
|
|
26
26
|
/**
|
|
27
27
|
* The candidate labels for this image
|
|
28
28
|
*/
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* The image data to generate bounding boxes from
|
|
32
|
-
*/
|
|
33
|
-
image: unknown;
|
|
29
|
+
candidate_labels: string[];
|
|
34
30
|
[property: string]: unknown;
|
|
35
31
|
}
|
|
36
32
|
/**
|
|
@@ -6,22 +6,8 @@
|
|
|
6
6
|
"type": "object",
|
|
7
7
|
"properties": {
|
|
8
8
|
"inputs": {
|
|
9
|
-
"description": "The input image data
|
|
10
|
-
"type": "
|
|
11
|
-
"title": "ZeroShotObjectDetectionInputData",
|
|
12
|
-
"properties": {
|
|
13
|
-
"image": {
|
|
14
|
-
"description": "The image data to generate bounding boxes from"
|
|
15
|
-
},
|
|
16
|
-
"candidateLabels": {
|
|
17
|
-
"description": "The candidate labels for this image",
|
|
18
|
-
"type": "array",
|
|
19
|
-
"items": {
|
|
20
|
-
"type": "string"
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
},
|
|
24
|
-
"required": ["image", "candidateLabels"]
|
|
9
|
+
"description": "The input image data as a base64-encoded string.",
|
|
10
|
+
"type": "string"
|
|
25
11
|
},
|
|
26
12
|
"parameters": {
|
|
27
13
|
"description": "Additional inference parameters",
|
|
@@ -33,8 +19,17 @@
|
|
|
33
19
|
"title": "ZeroShotObjectDetectionParameters",
|
|
34
20
|
"description": "Additional inference parameters for Zero Shot Object Detection",
|
|
35
21
|
"type": "object",
|
|
36
|
-
"properties": {
|
|
22
|
+
"properties": {
|
|
23
|
+
"candidate_labels": {
|
|
24
|
+
"description": "The candidate labels for this image",
|
|
25
|
+
"type": "array",
|
|
26
|
+
"items": {
|
|
27
|
+
"type": "string"
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"required": ["candidate_labels"]
|
|
37
32
|
}
|
|
38
33
|
},
|
|
39
|
-
"required": ["inputs"]
|
|
34
|
+
"required": ["inputs", "parameters"]
|
|
40
35
|
}
|