@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.
Files changed (67) hide show
  1. package/dist/commonjs/index.d.ts +1 -0
  2. package/dist/commonjs/index.d.ts.map +1 -1
  3. package/dist/commonjs/model-libraries.d.ts +8 -1
  4. package/dist/commonjs/model-libraries.d.ts.map +1 -1
  5. package/dist/commonjs/model-libraries.js +7 -0
  6. package/dist/commonjs/pipelines.d.ts +7 -1
  7. package/dist/commonjs/pipelines.d.ts.map +1 -1
  8. package/dist/commonjs/pipelines.js +6 -0
  9. package/dist/commonjs/tasks/automatic-speech-recognition/data.d.ts.map +1 -1
  10. package/dist/commonjs/tasks/automatic-speech-recognition/data.js +15 -3
  11. package/dist/commonjs/tasks/document-question-answering/inference.d.ts +0 -4
  12. package/dist/commonjs/tasks/document-question-answering/inference.d.ts.map +1 -1
  13. package/dist/commonjs/tasks/index.d.ts +1 -1
  14. package/dist/commonjs/tasks/index.d.ts.map +1 -1
  15. package/dist/commonjs/tasks/index.js +2 -0
  16. package/dist/commonjs/tasks/mask-generation/data.d.ts.map +1 -1
  17. package/dist/commonjs/tasks/mask-generation/data.js +16 -2
  18. package/dist/commonjs/tasks/text-to-speech/data.d.ts.map +1 -1
  19. package/dist/commonjs/tasks/text-to-speech/data.js +15 -7
  20. package/dist/commonjs/tasks/zero-shot-classification/inference.d.ts +9 -19
  21. package/dist/commonjs/tasks/zero-shot-classification/inference.d.ts.map +1 -1
  22. package/dist/commonjs/tasks/zero-shot-image-classification/inference.d.ts +9 -19
  23. package/dist/commonjs/tasks/zero-shot-image-classification/inference.d.ts.map +1 -1
  24. package/dist/commonjs/tasks/zero-shot-object-detection/inference.d.ts +8 -12
  25. package/dist/commonjs/tasks/zero-shot-object-detection/inference.d.ts.map +1 -1
  26. package/dist/esm/index.d.ts +1 -0
  27. package/dist/esm/index.d.ts.map +1 -1
  28. package/dist/esm/model-libraries.d.ts +8 -1
  29. package/dist/esm/model-libraries.d.ts.map +1 -1
  30. package/dist/esm/model-libraries.js +7 -0
  31. package/dist/esm/pipelines.d.ts +7 -1
  32. package/dist/esm/pipelines.d.ts.map +1 -1
  33. package/dist/esm/pipelines.js +6 -0
  34. package/dist/esm/tasks/automatic-speech-recognition/data.d.ts.map +1 -1
  35. package/dist/esm/tasks/automatic-speech-recognition/data.js +15 -3
  36. package/dist/esm/tasks/document-question-answering/inference.d.ts +0 -4
  37. package/dist/esm/tasks/document-question-answering/inference.d.ts.map +1 -1
  38. package/dist/esm/tasks/index.d.ts +1 -1
  39. package/dist/esm/tasks/index.d.ts.map +1 -1
  40. package/dist/esm/tasks/index.js +2 -0
  41. package/dist/esm/tasks/mask-generation/data.d.ts.map +1 -1
  42. package/dist/esm/tasks/mask-generation/data.js +16 -2
  43. package/dist/esm/tasks/text-to-speech/data.d.ts.map +1 -1
  44. package/dist/esm/tasks/text-to-speech/data.js +15 -7
  45. package/dist/esm/tasks/zero-shot-classification/inference.d.ts +9 -19
  46. package/dist/esm/tasks/zero-shot-classification/inference.d.ts.map +1 -1
  47. package/dist/esm/tasks/zero-shot-image-classification/inference.d.ts +9 -19
  48. package/dist/esm/tasks/zero-shot-image-classification/inference.d.ts.map +1 -1
  49. package/dist/esm/tasks/zero-shot-object-detection/inference.d.ts +8 -12
  50. package/dist/esm/tasks/zero-shot-object-detection/inference.d.ts.map +1 -1
  51. package/package.json +1 -1
  52. package/src/index.ts +1 -0
  53. package/src/model-libraries.ts +7 -0
  54. package/src/pipelines.ts +6 -0
  55. package/src/tasks/automatic-speech-recognition/data.ts +15 -3
  56. package/src/tasks/document-question-answering/inference.ts +0 -4
  57. package/src/tasks/document-question-answering/spec/output.json +1 -8
  58. package/src/tasks/index.ts +2 -1
  59. package/src/tasks/mask-generation/about.md +10 -0
  60. package/src/tasks/mask-generation/data.ts +16 -2
  61. package/src/tasks/text-to-speech/data.ts +15 -7
  62. package/src/tasks/zero-shot-classification/inference.ts +9 -19
  63. package/src/tasks/zero-shot-classification/spec/input.json +13 -20
  64. package/src/tasks/zero-shot-image-classification/inference.ts +9 -19
  65. package/src/tasks/zero-shot-image-classification/spec/input.json +13 -19
  66. package/src/tasks/zero-shot-object-detection/inference.ts +8 -12
  67. 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 input text data, with candidate labels
11
+ * The text to classify
12
12
  */
13
- inputs: ZeroShotClassificationInputData;
13
+ inputs: string;
14
14
  /**
15
15
  * Additional inference parameters
16
16
  */
17
- parameters?: ZeroShotClassificationParameters;
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 sentence used in conjunction with candidateLabels to attempt the text classification
42
- * by replacing the placeholder with the candidate labels.
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 input text data, with candidate labels",
10
- "type": "object",
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 candidateLabels to attempt the text classification by replacing the placeholder with the candidate labels."
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, with candidate labels
11
+ * The input image data to classify as a base64-encoded string.
12
12
  */
13
- inputs: ZeroShotImageClassificationInputData;
13
+ inputs: string;
14
14
  /**
15
15
  * Additional inference parameters
16
16
  */
17
- parameters?: ZeroShotImageClassificationParameters;
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 sentence used in conjunction with candidateLabels to attempt the text classification
42
- * by replacing the placeholder with the candidate labels.
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
- "description": "The input image data, with candidate labels",
10
- "type": "object",
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 candidateLabels to attempt the text classification by replacing the placeholder with the candidate labels."
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, with candidate labels
11
+ * The input image data as a base64-encoded string.
12
12
  */
13
- inputs: ZeroShotObjectDetectionInputData;
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
- * The input image data, with candidate labels
21
+ * Additional inference parameters
22
+ *
23
+ * Additional inference parameters for Zero Shot Object Detection
24
24
  */
25
- export interface ZeroShotObjectDetectionInputData {
25
+ export interface ZeroShotObjectDetectionParameters {
26
26
  /**
27
27
  * The candidate labels for this image
28
28
  */
29
- candidateLabels: string[];
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, with candidate labels",
10
- "type": "object",
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
  }