@huggingface/tasks 0.2.2 → 0.3.1

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 (79) hide show
  1. package/README.md +1 -1
  2. package/dist/index.cjs +3144 -3085
  3. package/dist/index.d.ts +441 -74
  4. package/dist/index.js +3143 -3084
  5. package/package.json +1 -1
  6. package/src/index.ts +2 -5
  7. package/src/library-to-tasks.ts +1 -1
  8. package/src/model-libraries-downloads.ts +20 -0
  9. package/src/{library-ui-elements.ts → model-libraries-snippets.ts} +46 -292
  10. package/src/model-libraries.ts +375 -44
  11. package/src/pipelines.ts +14 -8
  12. package/src/tasks/audio-classification/inference.ts +4 -4
  13. package/src/tasks/audio-classification/spec/input.json +4 -4
  14. package/src/tasks/audio-classification/spec/output.json +1 -12
  15. package/src/tasks/automatic-speech-recognition/inference.ts +35 -30
  16. package/src/tasks/automatic-speech-recognition/spec/input.json +3 -3
  17. package/src/tasks/automatic-speech-recognition/spec/output.json +30 -28
  18. package/src/tasks/common-definitions.json +25 -17
  19. package/src/tasks/depth-estimation/inference.ts +10 -10
  20. package/src/tasks/depth-estimation/spec/input.json +3 -8
  21. package/src/tasks/depth-estimation/spec/output.json +9 -3
  22. package/src/tasks/document-question-answering/inference.ts +16 -8
  23. package/src/tasks/document-question-answering/spec/input.json +9 -9
  24. package/src/tasks/document-question-answering/spec/output.json +2 -2
  25. package/src/tasks/feature-extraction/inference.ts +1 -1
  26. package/src/tasks/feature-extraction/spec/input.json +2 -2
  27. package/src/tasks/fill-mask/inference.ts +4 -3
  28. package/src/tasks/fill-mask/spec/input.json +3 -3
  29. package/src/tasks/fill-mask/spec/output.json +1 -1
  30. package/src/tasks/image-classification/inference.ts +3 -3
  31. package/src/tasks/image-classification/spec/input.json +4 -4
  32. package/src/tasks/image-segmentation/inference.ts +3 -3
  33. package/src/tasks/image-segmentation/spec/input.json +4 -4
  34. package/src/tasks/image-to-image/inference.ts +5 -5
  35. package/src/tasks/image-to-image/spec/input.json +9 -7
  36. package/src/tasks/image-to-text/inference.ts +25 -20
  37. package/src/tasks/image-to-text/spec/input.json +3 -3
  38. package/src/tasks/image-to-text/spec/output.json +8 -11
  39. package/src/tasks/index.ts +2 -0
  40. package/src/tasks/object-detection/inference.ts +1 -1
  41. package/src/tasks/object-detection/spec/input.json +2 -2
  42. package/src/tasks/placeholder/spec/input.json +4 -4
  43. package/src/tasks/placeholder/spec/output.json +1 -1
  44. package/src/tasks/question-answering/inference.ts +8 -8
  45. package/src/tasks/question-answering/spec/input.json +9 -9
  46. package/src/tasks/sentence-similarity/inference.ts +1 -1
  47. package/src/tasks/sentence-similarity/spec/input.json +2 -2
  48. package/src/tasks/summarization/inference.ts +5 -4
  49. package/src/tasks/table-question-answering/inference.ts +1 -1
  50. package/src/tasks/table-question-answering/spec/input.json +8 -3
  51. package/src/tasks/text-classification/inference.ts +3 -3
  52. package/src/tasks/text-classification/spec/input.json +4 -4
  53. package/src/tasks/text-generation/inference.ts +123 -14
  54. package/src/tasks/text-generation/spec/input.json +28 -12
  55. package/src/tasks/text-generation/spec/output.json +112 -9
  56. package/src/tasks/text-to-audio/inference.ts +24 -19
  57. package/src/tasks/text-to-audio/spec/input.json +2 -2
  58. package/src/tasks/text-to-audio/spec/output.json +10 -13
  59. package/src/tasks/text-to-image/inference.ts +6 -8
  60. package/src/tasks/text-to-image/spec/input.json +9 -7
  61. package/src/tasks/text-to-image/spec/output.json +7 -9
  62. package/src/tasks/text-to-speech/inference.ts +18 -17
  63. package/src/tasks/text2text-generation/inference.ts +10 -8
  64. package/src/tasks/text2text-generation/spec/input.json +4 -4
  65. package/src/tasks/text2text-generation/spec/output.json +8 -11
  66. package/src/tasks/token-classification/inference.ts +4 -4
  67. package/src/tasks/token-classification/spec/input.json +4 -4
  68. package/src/tasks/token-classification/spec/output.json +1 -1
  69. package/src/tasks/translation/inference.ts +5 -4
  70. package/src/tasks/video-classification/inference.ts +5 -5
  71. package/src/tasks/video-classification/spec/input.json +6 -6
  72. package/src/tasks/visual-question-answering/inference.ts +2 -2
  73. package/src/tasks/visual-question-answering/spec/input.json +3 -3
  74. package/src/tasks/zero-shot-classification/inference.ts +3 -3
  75. package/src/tasks/zero-shot-classification/spec/input.json +4 -4
  76. package/src/tasks/zero-shot-image-classification/inference.ts +2 -2
  77. package/src/tasks/zero-shot-image-classification/spec/input.json +3 -3
  78. package/src/tasks/zero-shot-object-detection/inference.ts +1 -1
  79. package/src/tasks/zero-shot-object-detection/spec/input.json +2 -2
@@ -10,7 +10,7 @@ export interface ZeroShotImageClassificationInput {
10
10
  /**
11
11
  * The input image data, with candidate labels
12
12
  */
13
- data: ZeroShotImageClassificationInputData;
13
+ inputs: ZeroShotImageClassificationInputData;
14
14
  /**
15
15
  * Additional inference parameters
16
16
  */
@@ -41,7 +41,7 @@ export interface ZeroShotImageClassificationParameters {
41
41
  * The sentence used in conjunction with candidateLabels to attempt the text classification
42
42
  * by replacing the placeholder with the candidate labels.
43
43
  */
44
- hypothesisTemplate?: string;
44
+ hypothesis_template?: string;
45
45
  [property: string]: unknown;
46
46
  }
47
47
  export type ZeroShotImageClassificationOutput = ZeroShotImageClassificationOutputElement[];
@@ -5,7 +5,7 @@
5
5
  "title": "ZeroShotImageClassificationInput",
6
6
  "type": "object",
7
7
  "properties": {
8
- "data": {
8
+ "inputs": {
9
9
  "description": "The input image data, with candidate labels",
10
10
  "type": "object",
11
11
  "title": "ZeroShotImageClassificationInputData",
@@ -34,12 +34,12 @@
34
34
  "description": "Additional inference parameters for Zero Shot Image Classification",
35
35
  "type": "object",
36
36
  "properties": {
37
- "hypothesisTemplate": {
37
+ "hypothesis_template": {
38
38
  "type": "string",
39
39
  "description": "The sentence used in conjunction with candidateLabels to attempt the text classification by replacing the placeholder with the candidate labels."
40
40
  }
41
41
  }
42
42
  }
43
43
  },
44
- "required": ["data"]
44
+ "required": ["inputs"]
45
45
  }
@@ -10,7 +10,7 @@ export interface ZeroShotObjectDetectionInput {
10
10
  /**
11
11
  * The input image data, with candidate labels
12
12
  */
13
- data: ZeroShotObjectDetectionInputData;
13
+ inputs: ZeroShotObjectDetectionInputData;
14
14
  /**
15
15
  * Additional inference parameters
16
16
  */
@@ -5,7 +5,7 @@
5
5
  "title": "ZeroShotObjectDetectionInput",
6
6
  "type": "object",
7
7
  "properties": {
8
- "data": {
8
+ "inputs": {
9
9
  "description": "The input image data, with candidate labels",
10
10
  "type": "object",
11
11
  "title": "ZeroShotObjectDetectionInputData",
@@ -36,5 +36,5 @@
36
36
  "properties": {}
37
37
  }
38
38
  },
39
- "required": ["data"]
39
+ "required": ["inputs"]
40
40
  }