@huggingface/tasks 0.0.2 → 0.0.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 (107) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +20 -0
  3. package/dist/index.d.ts +358 -46
  4. package/dist/index.js +103 -41
  5. package/dist/{index.cjs → index.mjs} +73 -67
  6. package/package.json +42 -33
  7. package/src/Types.ts +49 -43
  8. package/src/audio-classification/about.md +5 -5
  9. package/src/audio-classification/data.ts +11 -11
  10. package/src/audio-to-audio/about.md +4 -3
  11. package/src/audio-to-audio/data.ts +18 -15
  12. package/src/automatic-speech-recognition/about.md +5 -4
  13. package/src/automatic-speech-recognition/data.ts +18 -17
  14. package/src/const.ts +52 -44
  15. package/src/conversational/about.md +9 -9
  16. package/src/conversational/data.ts +22 -18
  17. package/src/depth-estimation/about.md +1 -3
  18. package/src/depth-estimation/data.ts +11 -11
  19. package/src/document-question-answering/about.md +1 -2
  20. package/src/document-question-answering/data.ts +22 -19
  21. package/src/feature-extraction/about.md +2 -3
  22. package/src/feature-extraction/data.ts +12 -15
  23. package/src/fill-mask/about.md +1 -1
  24. package/src/fill-mask/data.ts +16 -14
  25. package/src/image-classification/about.md +5 -3
  26. package/src/image-classification/data.ts +15 -15
  27. package/src/image-segmentation/about.md +4 -4
  28. package/src/image-segmentation/data.ts +26 -23
  29. package/src/image-to-image/about.md +8 -10
  30. package/src/image-to-image/data.ts +31 -27
  31. package/src/image-to-text/about.md +13 -6
  32. package/src/image-to-text/data.ts +20 -21
  33. package/src/index.ts +3 -1
  34. package/src/modelLibraries.ts +43 -0
  35. package/src/object-detection/about.md +2 -1
  36. package/src/object-detection/data.ts +20 -17
  37. package/src/pipelines.ts +608 -0
  38. package/src/placeholder/about.md +3 -3
  39. package/src/placeholder/data.ts +8 -8
  40. package/src/question-answering/about.md +1 -1
  41. package/src/question-answering/data.ts +21 -19
  42. package/src/reinforcement-learning/about.md +167 -176
  43. package/src/reinforcement-learning/data.ts +75 -78
  44. package/src/sentence-similarity/data.ts +29 -28
  45. package/src/summarization/about.md +6 -5
  46. package/src/summarization/data.ts +23 -20
  47. package/src/table-question-answering/about.md +5 -5
  48. package/src/table-question-answering/data.ts +35 -39
  49. package/src/tabular-classification/about.md +4 -6
  50. package/src/tabular-classification/data.ts +11 -12
  51. package/src/tabular-regression/about.md +14 -18
  52. package/src/tabular-regression/data.ts +10 -11
  53. package/src/tasksData.ts +47 -50
  54. package/src/text-classification/about.md +5 -4
  55. package/src/text-classification/data.ts +21 -20
  56. package/src/text-generation/about.md +7 -6
  57. package/src/text-generation/data.ts +36 -34
  58. package/src/text-to-image/about.md +19 -18
  59. package/src/text-to-image/data.ts +32 -26
  60. package/src/text-to-speech/about.md +4 -5
  61. package/src/text-to-speech/data.ts +16 -17
  62. package/src/text-to-video/about.md +41 -36
  63. package/src/text-to-video/data.ts +43 -38
  64. package/src/token-classification/about.md +1 -3
  65. package/src/token-classification/data.ts +26 -25
  66. package/src/translation/about.md +4 -4
  67. package/src/translation/data.ts +21 -21
  68. package/src/unconditional-image-generation/about.md +10 -5
  69. package/src/unconditional-image-generation/data.ts +26 -20
  70. package/src/video-classification/about.md +5 -1
  71. package/src/video-classification/data.ts +14 -14
  72. package/src/visual-question-answering/about.md +8 -3
  73. package/src/visual-question-answering/data.ts +22 -19
  74. package/src/zero-shot-classification/about.md +5 -4
  75. package/src/zero-shot-classification/data.ts +20 -20
  76. package/src/zero-shot-image-classification/about.md +17 -9
  77. package/src/zero-shot-image-classification/data.ts +12 -14
  78. package/tsconfig.json +18 -0
  79. package/assets/audio-classification/audio.wav +0 -0
  80. package/assets/audio-to-audio/input.wav +0 -0
  81. package/assets/audio-to-audio/label-0.wav +0 -0
  82. package/assets/audio-to-audio/label-1.wav +0 -0
  83. package/assets/automatic-speech-recognition/input.flac +0 -0
  84. package/assets/automatic-speech-recognition/wav2vec2.png +0 -0
  85. package/assets/contribution-guide/anatomy.png +0 -0
  86. package/assets/contribution-guide/libraries.png +0 -0
  87. package/assets/depth-estimation/depth-estimation-input.jpg +0 -0
  88. package/assets/depth-estimation/depth-estimation-output.png +0 -0
  89. package/assets/document-question-answering/document-question-answering-input.png +0 -0
  90. package/assets/image-classification/image-classification-input.jpeg +0 -0
  91. package/assets/image-segmentation/image-segmentation-input.jpeg +0 -0
  92. package/assets/image-segmentation/image-segmentation-output.png +0 -0
  93. package/assets/image-to-image/image-to-image-input.jpeg +0 -0
  94. package/assets/image-to-image/image-to-image-output.png +0 -0
  95. package/assets/image-to-image/pix2pix_examples.jpg +0 -0
  96. package/assets/image-to-text/savanna.jpg +0 -0
  97. package/assets/object-detection/object-detection-input.jpg +0 -0
  98. package/assets/object-detection/object-detection-output.jpg +0 -0
  99. package/assets/table-question-answering/tableQA.jpg +0 -0
  100. package/assets/text-to-image/image.jpeg +0 -0
  101. package/assets/text-to-speech/audio.wav +0 -0
  102. package/assets/text-to-video/text-to-video-output.gif +0 -0
  103. package/assets/unconditional-image-generation/unconditional-image-generation-output.jpeg +0 -0
  104. package/assets/video-classification/video-classification-input.gif +0 -0
  105. package/assets/visual-question-answering/elephant.jpeg +0 -0
  106. package/assets/zero-shot-image-classification/image-classification-input.jpeg +0 -0
  107. package/dist/index.d.cts +0 -145
Binary file
Binary file
package/dist/index.d.cts DELETED
@@ -1,145 +0,0 @@
1
- declare const MODALITIES: readonly ["cv", "nlp", "audio", "tabular", "multimodal", "rl", "other"];
2
- type Modality = typeof MODALITIES[number];
3
- /**
4
- * Public interface for a sub task.
5
- *
6
- * This can be used in a model card's `model-index` metadata.
7
- * and is more granular classification that can grow significantly
8
- * over time as new tasks are added.
9
- */
10
- interface SubTask {
11
- /**
12
- * type of the task (e.g. audio-source-separation)
13
- */
14
- type: string;
15
- /**
16
- * displayed name of the task (e.g. Audio Source Separation)
17
- */
18
- name: string;
19
- }
20
- /**
21
- * Public interface for a PipelineData.
22
- *
23
- * This information corresponds to a pipeline type (aka task)
24
- * in the Hub.
25
- */
26
- interface PipelineData {
27
- /**
28
- * displayed name of the task (e.g. Text Classification)
29
- */
30
- name: string;
31
- subtasks?: SubTask[];
32
- modality: Modality;
33
- /**
34
- * color for the tag icon.
35
- */
36
- color: "blue" | "green" | "indigo" | "orange" | "red" | "yellow";
37
- /**
38
- * whether to hide in /models filters
39
- */
40
- hideInModels?: boolean;
41
- /**
42
- * whether to hide in /datasets filters
43
- */
44
- hideInDatasets?: boolean;
45
- }
46
- declare const PIPELINE_DATA: Record<"other" | "text-classification" | "token-classification" | "table-question-answering" | "question-answering" | "zero-shot-classification" | "translation" | "summarization" | "conversational" | "feature-extraction" | "text-generation" | "text2text-generation" | "fill-mask" | "sentence-similarity" | "text-to-speech" | "text-to-audio" | "automatic-speech-recognition" | "audio-to-audio" | "audio-classification" | "voice-activity-detection" | "depth-estimation" | "image-classification" | "object-detection" | "image-segmentation" | "text-to-image" | "image-to-text" | "image-to-image" | "unconditional-image-generation" | "video-classification" | "reinforcement-learning" | "robotics" | "tabular-classification" | "tabular-regression" | "tabular-to-text" | "table-to-text" | "multiple-choice" | "text-retrieval" | "time-series-forecasting" | "text-to-video" | "visual-question-answering" | "document-question-answering" | "zero-shot-image-classification" | "graph-ml", PipelineData>;
47
- type PipelineType = keyof typeof PIPELINE_DATA;
48
-
49
- /**
50
- * Add your new library here.
51
- *
52
- * This is for modeling (= architectures) libraries, not for file formats (like ONNX, etc).
53
- * File formats live in an enum inside the internal codebase.
54
- */
55
- declare enum ModelLibrary {
56
- "adapter-transformers" = "Adapter Transformers",
57
- "allennlp" = "allenNLP",
58
- "asteroid" = "Asteroid",
59
- "bertopic" = "BERTopic",
60
- "diffusers" = "Diffusers",
61
- "doctr" = "docTR",
62
- "espnet" = "ESPnet",
63
- "fairseq" = "Fairseq",
64
- "flair" = "Flair",
65
- "keras" = "Keras",
66
- "k2" = "K2",
67
- "nemo" = "NeMo",
68
- "open_clip" = "OpenCLIP",
69
- "paddlenlp" = "PaddleNLP",
70
- "peft" = "PEFT",
71
- "pyannote-audio" = "pyannote.audio",
72
- "sample-factory" = "Sample Factory",
73
- "sentence-transformers" = "Sentence Transformers",
74
- "sklearn" = "Scikit-learn",
75
- "spacy" = "spaCy",
76
- "span-marker" = "SpanMarker",
77
- "speechbrain" = "speechbrain",
78
- "tensorflowtts" = "TensorFlowTTS",
79
- "timm" = "Timm",
80
- "fastai" = "fastai",
81
- "transformers" = "Transformers",
82
- "transformers.js" = "Transformers.js",
83
- "stanza" = "Stanza",
84
- "fasttext" = "fastText",
85
- "stable-baselines3" = "Stable-Baselines3",
86
- "ml-agents" = "ML-Agents",
87
- "pythae" = "Pythae",
88
- "mindspore" = "MindSpore"
89
- }
90
- type ModelLibraryKey = keyof typeof ModelLibrary;
91
-
92
- interface ExampleRepo {
93
- description: string;
94
- id: string;
95
- }
96
- type TaskDemoEntry = {
97
- filename: string;
98
- type: "audio";
99
- } | {
100
- data: Array<{
101
- label: string;
102
- score: number;
103
- }>;
104
- type: "chart";
105
- } | {
106
- filename: string;
107
- type: "img";
108
- } | {
109
- table: string[][];
110
- type: "tabular";
111
- } | {
112
- content: string;
113
- label: string;
114
- type: "text";
115
- } | {
116
- text: string;
117
- tokens: Array<{
118
- end: number;
119
- start: number;
120
- type: string;
121
- }>;
122
- type: "text-with-tokens";
123
- };
124
- interface TaskDemo {
125
- inputs: TaskDemoEntry[];
126
- outputs: TaskDemoEntry[];
127
- }
128
- interface TaskData {
129
- datasets: ExampleRepo[];
130
- demo: TaskDemo;
131
- id: PipelineType;
132
- isPlaceholder?: boolean;
133
- label: string;
134
- libraries: ModelLibraryKey[];
135
- metrics: ExampleRepo[];
136
- models: ExampleRepo[];
137
- spaces: ExampleRepo[];
138
- summary: string;
139
- widgetModels: string[];
140
- youtubeId?: string;
141
- }
142
-
143
- declare const TASKS_DATA: Record<PipelineType, TaskData | undefined>;
144
-
145
- export { type ExampleRepo, TASKS_DATA, type TaskData, type TaskDemo, type TaskDemoEntry };