@huggingface/tasks 0.0.5 → 0.0.6

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/index.d.ts CHANGED
@@ -40,6 +40,7 @@ declare enum ModelLibrary {
40
40
  "mindspore" = "MindSpore"
41
41
  }
42
42
  type ModelLibraryKey = keyof typeof ModelLibrary;
43
+ declare const ALL_DISPLAY_MODEL_LIBRARY_KEYS: string[];
43
44
 
44
45
  declare const MODALITIES: readonly ["cv", "nlp", "audio", "tabular", "multimodal", "rl", "other"];
45
46
  type Modality = (typeof MODALITIES)[number];
@@ -410,6 +411,8 @@ declare const PIPELINE_DATA: {
410
411
  };
411
412
  type PipelineType = keyof typeof PIPELINE_DATA;
412
413
  declare const PIPELINE_TYPES: ("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")[];
414
+ declare const SUBTASK_TYPES: string[];
415
+ declare const PIPELINE_TYPES_SET: Set<"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">;
413
416
 
414
417
  interface ExampleRepo {
415
418
  description: string;
@@ -464,4 +467,9 @@ interface TaskData {
464
467
 
465
468
  declare const TASKS_DATA: Record<PipelineType, TaskData | undefined>;
466
469
 
467
- export { ExampleRepo, MODALITIES, MODALITY_LABELS, Modality, ModelLibrary, ModelLibraryKey, PIPELINE_DATA, PIPELINE_TYPES, PipelineData, PipelineType, TASKS_DATA, TaskData, TaskDemo, TaskDemoEntry };
470
+ declare const TAG_NFAA_CONTENT = "not-for-all-audiences";
471
+ declare const OTHER_TAGS_SUGGESTIONS: string[];
472
+ declare const TAG_TEXT_GENERATION_INFERENCE = "text-generation-inference";
473
+ declare const TAG_CUSTOM_CODE = "custom_code";
474
+
475
+ export { ALL_DISPLAY_MODEL_LIBRARY_KEYS, ExampleRepo, MODALITIES, MODALITY_LABELS, Modality, ModelLibrary, ModelLibraryKey, OTHER_TAGS_SUGGESTIONS, PIPELINE_DATA, PIPELINE_TYPES, PIPELINE_TYPES_SET, PipelineData, PipelineType, SUBTASK_TYPES, TAG_CUSTOM_CODE, TAG_NFAA_CONTENT, TAG_TEXT_GENERATION_INFERENCE, TASKS_DATA, TaskData, TaskDemo, TaskDemoEntry };
package/dist/index.js CHANGED
@@ -20,11 +20,18 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
20
20
  // src/index.ts
21
21
  var src_exports = {};
22
22
  __export(src_exports, {
23
+ ALL_DISPLAY_MODEL_LIBRARY_KEYS: () => ALL_DISPLAY_MODEL_LIBRARY_KEYS,
23
24
  MODALITIES: () => MODALITIES,
24
25
  MODALITY_LABELS: () => MODALITY_LABELS,
25
26
  ModelLibrary: () => ModelLibrary,
27
+ OTHER_TAGS_SUGGESTIONS: () => OTHER_TAGS_SUGGESTIONS,
26
28
  PIPELINE_DATA: () => PIPELINE_DATA,
27
29
  PIPELINE_TYPES: () => PIPELINE_TYPES,
30
+ PIPELINE_TYPES_SET: () => PIPELINE_TYPES_SET,
31
+ SUBTASK_TYPES: () => SUBTASK_TYPES,
32
+ TAG_CUSTOM_CODE: () => TAG_CUSTOM_CODE,
33
+ TAG_NFAA_CONTENT: () => TAG_NFAA_CONTENT,
34
+ TAG_TEXT_GENERATION_INFERENCE: () => TAG_TEXT_GENERATION_INFERENCE,
28
35
  TASKS_DATA: () => TASKS_DATA
29
36
  });
30
37
  module.exports = __toCommonJS(src_exports);
@@ -586,6 +593,8 @@ var PIPELINE_DATA = {
586
593
  }
587
594
  };
588
595
  var PIPELINE_TYPES = Object.keys(PIPELINE_DATA);
596
+ var SUBTASK_TYPES = Object.values(PIPELINE_DATA).flatMap((data) => "subtasks" in data ? data.subtasks : []).map((s) => s.type);
597
+ var PIPELINE_TYPES_SET = new Set(PIPELINE_TYPES);
589
598
 
590
599
  // src/audio-classification/data.ts
591
600
  var taskData = {
@@ -3144,12 +3153,39 @@ var ModelLibrary = /* @__PURE__ */ ((ModelLibrary2) => {
3144
3153
  ModelLibrary2["mindspore"] = "MindSpore";
3145
3154
  return ModelLibrary2;
3146
3155
  })(ModelLibrary || {});
3156
+ var ALL_DISPLAY_MODEL_LIBRARY_KEYS = Object.keys(ModelLibrary).filter(
3157
+ (k) => !["doctr", "k2", "mindspore", "tensorflowtts"].includes(k)
3158
+ );
3159
+
3160
+ // src/tags.ts
3161
+ var TAG_NFAA_CONTENT = "not-for-all-audiences";
3162
+ var OTHER_TAGS_SUGGESTIONS = [
3163
+ "chemistry",
3164
+ "biology",
3165
+ "finance",
3166
+ "legal",
3167
+ "music",
3168
+ "art",
3169
+ "code",
3170
+ "climate",
3171
+ "medical",
3172
+ TAG_NFAA_CONTENT
3173
+ ];
3174
+ var TAG_TEXT_GENERATION_INFERENCE = "text-generation-inference";
3175
+ var TAG_CUSTOM_CODE = "custom_code";
3147
3176
  // Annotate the CommonJS export names for ESM import in node:
3148
3177
  0 && (module.exports = {
3178
+ ALL_DISPLAY_MODEL_LIBRARY_KEYS,
3149
3179
  MODALITIES,
3150
3180
  MODALITY_LABELS,
3151
3181
  ModelLibrary,
3182
+ OTHER_TAGS_SUGGESTIONS,
3152
3183
  PIPELINE_DATA,
3153
3184
  PIPELINE_TYPES,
3185
+ PIPELINE_TYPES_SET,
3186
+ SUBTASK_TYPES,
3187
+ TAG_CUSTOM_CODE,
3188
+ TAG_NFAA_CONTENT,
3189
+ TAG_TEXT_GENERATION_INFERENCE,
3154
3190
  TASKS_DATA
3155
3191
  });
package/dist/index.mjs CHANGED
@@ -555,6 +555,8 @@ var PIPELINE_DATA = {
555
555
  }
556
556
  };
557
557
  var PIPELINE_TYPES = Object.keys(PIPELINE_DATA);
558
+ var SUBTASK_TYPES = Object.values(PIPELINE_DATA).flatMap((data) => "subtasks" in data ? data.subtasks : []).map((s) => s.type);
559
+ var PIPELINE_TYPES_SET = new Set(PIPELINE_TYPES);
558
560
 
559
561
  // src/audio-classification/data.ts
560
562
  var taskData = {
@@ -3113,11 +3115,38 @@ var ModelLibrary = /* @__PURE__ */ ((ModelLibrary2) => {
3113
3115
  ModelLibrary2["mindspore"] = "MindSpore";
3114
3116
  return ModelLibrary2;
3115
3117
  })(ModelLibrary || {});
3118
+ var ALL_DISPLAY_MODEL_LIBRARY_KEYS = Object.keys(ModelLibrary).filter(
3119
+ (k) => !["doctr", "k2", "mindspore", "tensorflowtts"].includes(k)
3120
+ );
3121
+
3122
+ // src/tags.ts
3123
+ var TAG_NFAA_CONTENT = "not-for-all-audiences";
3124
+ var OTHER_TAGS_SUGGESTIONS = [
3125
+ "chemistry",
3126
+ "biology",
3127
+ "finance",
3128
+ "legal",
3129
+ "music",
3130
+ "art",
3131
+ "code",
3132
+ "climate",
3133
+ "medical",
3134
+ TAG_NFAA_CONTENT
3135
+ ];
3136
+ var TAG_TEXT_GENERATION_INFERENCE = "text-generation-inference";
3137
+ var TAG_CUSTOM_CODE = "custom_code";
3116
3138
  export {
3139
+ ALL_DISPLAY_MODEL_LIBRARY_KEYS,
3117
3140
  MODALITIES,
3118
3141
  MODALITY_LABELS,
3119
3142
  ModelLibrary,
3143
+ OTHER_TAGS_SUGGESTIONS,
3120
3144
  PIPELINE_DATA,
3121
3145
  PIPELINE_TYPES,
3146
+ PIPELINE_TYPES_SET,
3147
+ SUBTASK_TYPES,
3148
+ TAG_CUSTOM_CODE,
3149
+ TAG_NFAA_CONTENT,
3150
+ TAG_TEXT_GENERATION_INFERENCE,
3122
3151
  TASKS_DATA
3123
3152
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@huggingface/tasks",
3
3
  "packageManager": "pnpm@8.10.5",
4
- "version": "0.0.5",
4
+ "version": "0.0.6",
5
5
  "description": "List of ML tasks for huggingface.co/tasks",
6
6
  "repository": "https://github.com/huggingface/huggingface.js.git",
7
7
  "publishConfig": {
package/src/index.ts CHANGED
@@ -8,6 +8,10 @@ export {
8
8
  type Modality,
9
9
  MODALITIES,
10
10
  MODALITY_LABELS,
11
+ SUBTASK_TYPES,
12
+ PIPELINE_TYPES_SET,
11
13
  } from "./pipelines";
12
- export { ModelLibrary } from "./modelLibraries";
14
+ export { ModelLibrary, ALL_DISPLAY_MODEL_LIBRARY_KEYS } from "./modelLibraries";
13
15
  export type { ModelLibraryKey } from "./modelLibraries";
16
+
17
+ export { TAG_NFAA_CONTENT, OTHER_TAGS_SUGGESTIONS, TAG_TEXT_GENERATION_INFERENCE, TAG_CUSTOM_CODE } from "./tags";
@@ -41,3 +41,7 @@ export enum ModelLibrary {
41
41
  }
42
42
 
43
43
  export type ModelLibraryKey = keyof typeof ModelLibrary;
44
+
45
+ export const ALL_DISPLAY_MODEL_LIBRARY_KEYS = Object.keys(ModelLibrary).filter(
46
+ (k) => !["doctr", "k2", "mindspore", "tensorflowtts"].includes(k)
47
+ );
package/src/pipelines.ts CHANGED
@@ -616,4 +616,11 @@ export const PIPELINE_DATA = {
616
616
  } satisfies Record<string, PipelineData>;
617
617
 
618
618
  export type PipelineType = keyof typeof PIPELINE_DATA;
619
+
619
620
  export const PIPELINE_TYPES = Object.keys(PIPELINE_DATA) as PipelineType[];
621
+
622
+ export const SUBTASK_TYPES = Object.values(PIPELINE_DATA)
623
+ .flatMap((data) => ("subtasks" in data ? data.subtasks : []))
624
+ .map((s) => s.type);
625
+
626
+ export const PIPELINE_TYPES_SET = new Set(PIPELINE_TYPES);
package/src/tags.ts ADDED
@@ -0,0 +1,15 @@
1
+ export const TAG_NFAA_CONTENT = "not-for-all-audiences";
2
+ export const OTHER_TAGS_SUGGESTIONS = [
3
+ "chemistry",
4
+ "biology",
5
+ "finance",
6
+ "legal",
7
+ "music",
8
+ "art",
9
+ "code",
10
+ "climate",
11
+ "medical",
12
+ TAG_NFAA_CONTENT,
13
+ ];
14
+ export const TAG_TEXT_GENERATION_INFERENCE = "text-generation-inference";
15
+ export const TAG_CUSTOM_CODE = "custom_code";