@huggingface/tasks 0.15.6 → 0.15.8

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 (40) hide show
  1. package/dist/commonjs/hardware.d.ts +2 -2
  2. package/dist/commonjs/hardware.js +2 -2
  3. package/dist/commonjs/library-to-tasks.d.ts.map +1 -1
  4. package/dist/commonjs/library-to-tasks.js +2 -1
  5. package/dist/commonjs/model-libraries-snippets.js +7 -7
  6. package/dist/commonjs/tasks/automatic-speech-recognition/inference.d.ts +1 -1
  7. package/dist/commonjs/tasks/automatic-speech-recognition/inference.d.ts.map +1 -1
  8. package/dist/commonjs/tasks/feature-extraction/inference.d.ts +6 -2
  9. package/dist/commonjs/tasks/feature-extraction/inference.d.ts.map +1 -1
  10. package/dist/commonjs/tasks/image-text-to-text/data.js +3 -3
  11. package/dist/commonjs/tasks/text-generation/data.d.ts.map +1 -1
  12. package/dist/commonjs/tasks/text-generation/data.js +15 -4
  13. package/dist/commonjs/tasks/text-to-image/inference.d.ts +6 -10
  14. package/dist/commonjs/tasks/text-to-image/inference.d.ts.map +1 -1
  15. package/dist/esm/hardware.d.ts +2 -2
  16. package/dist/esm/hardware.js +2 -2
  17. package/dist/esm/library-to-tasks.d.ts.map +1 -1
  18. package/dist/esm/library-to-tasks.js +2 -1
  19. package/dist/esm/model-libraries-snippets.js +7 -7
  20. package/dist/esm/tasks/automatic-speech-recognition/inference.d.ts +1 -1
  21. package/dist/esm/tasks/automatic-speech-recognition/inference.d.ts.map +1 -1
  22. package/dist/esm/tasks/feature-extraction/inference.d.ts +6 -2
  23. package/dist/esm/tasks/feature-extraction/inference.d.ts.map +1 -1
  24. package/dist/esm/tasks/image-text-to-text/data.js +3 -3
  25. package/dist/esm/tasks/text-generation/data.d.ts.map +1 -1
  26. package/dist/esm/tasks/text-generation/data.js +15 -4
  27. package/dist/esm/tasks/text-to-image/inference.d.ts +6 -10
  28. package/dist/esm/tasks/text-to-image/inference.d.ts.map +1 -1
  29. package/package.json +1 -1
  30. package/src/hardware.ts +2 -2
  31. package/src/library-to-tasks.ts +2 -1
  32. package/src/model-libraries-snippets.ts +7 -7
  33. package/src/tasks/automatic-speech-recognition/inference.ts +1 -1
  34. package/src/tasks/automatic-speech-recognition/spec/output.json +2 -2
  35. package/src/tasks/feature-extraction/inference.ts +6 -2
  36. package/src/tasks/feature-extraction/spec/input.json +6 -2
  37. package/src/tasks/image-text-to-text/data.ts +3 -3
  38. package/src/tasks/text-generation/data.ts +15 -4
  39. package/src/tasks/text-to-image/inference.ts +6 -10
  40. package/src/tasks/text-to-image/spec/input.json +7 -12
@@ -1,6 +1,6 @@
1
1
  /**
2
- * Biden AI Executive Order
3
- * https://www.whitehouse.gov/briefing-room/presidential-actions/2023/10/30/executive-order-on-the-safe-secure-and-trustworthy-development-and-use-of-artificial-intelligence/
2
+ * Biden AI Executive Order (since revoked by President Trump):
3
+ * https://web.archive.org/web/20250105222429/https://www.whitehouse.gov/briefing-room/presidential-actions/2023/10/30/executive-order-on-the-safe-secure-and-trustworthy-development-and-use-of-artificial-intelligence/
4
4
  */
5
5
  export declare const TFLOPS_THRESHOLD_WHITE_HOUSE_MODEL_TRAINING_TOTAL: number;
6
6
  export declare const TFLOPS_THRESHOLD_WHITE_HOUSE_MODEL_TRAINING_TOTAL_BIOLOGY: number;
@@ -2,8 +2,8 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SKUS = exports.DEFAULT_MEMORY_OPTIONS = exports.TFLOPS_THRESHOLD_EU_AI_ACT_MODEL_TRAINING_TOTAL = exports.TFLOPS_THRESHOLD_WHITE_HOUSE_CLUSTER = exports.TFLOPS_THRESHOLD_WHITE_HOUSE_MODEL_TRAINING_TOTAL_BIOLOGY = exports.TFLOPS_THRESHOLD_WHITE_HOUSE_MODEL_TRAINING_TOTAL = void 0;
4
4
  /**
5
- * Biden AI Executive Order
6
- * https://www.whitehouse.gov/briefing-room/presidential-actions/2023/10/30/executive-order-on-the-safe-secure-and-trustworthy-development-and-use-of-artificial-intelligence/
5
+ * Biden AI Executive Order (since revoked by President Trump):
6
+ * https://web.archive.org/web/20250105222429/https://www.whitehouse.gov/briefing-room/presidential-actions/2023/10/30/executive-order-on-the-safe-secure-and-trustworthy-development-and-use-of-artificial-intelligence/
7
7
  */
8
8
  exports.TFLOPS_THRESHOLD_WHITE_HOUSE_MODEL_TRAINING_TOTAL = 10 ** 14;
9
9
  exports.TFLOPS_THRESHOLD_WHITE_HOUSE_MODEL_TRAINING_TOTAL_BIOLOGY = 10 ** 11;
@@ -1 +1 @@
1
- {"version":3,"file":"library-to-tasks.d.ts","sourceRoot":"","sources":["../../src/library-to-tasks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEnD;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,EAAE,OAAO,CAAC,MAAM,CAAC,eAAe,EAAE,YAAY,EAAE,CAAC,CAmEjF,CAAC"}
1
+ {"version":3,"file":"library-to-tasks.d.ts","sourceRoot":"","sources":["../../src/library-to-tasks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEnD;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,EAAE,OAAO,CAAC,MAAM,CAAC,eAAe,EAAE,YAAY,EAAE,CAAC,CAoEjF,CAAC"}
@@ -43,7 +43,7 @@ exports.LIBRARY_TASK_MAPPING = {
43
43
  "text2text-generation",
44
44
  ],
45
45
  stanza: ["token-classification"],
46
- timm: ["image-classification"],
46
+ timm: ["image-classification", "image-feature-extraction"],
47
47
  transformers: [
48
48
  "audio-classification",
49
49
  "automatic-speech-recognition",
@@ -52,6 +52,7 @@ exports.LIBRARY_TASK_MAPPING = {
52
52
  "feature-extraction",
53
53
  "fill-mask",
54
54
  "image-classification",
55
+ "image-feature-extraction",
55
56
  "image-segmentation",
56
57
  "image-to-image",
57
58
  "image-to-text",
@@ -425,7 +425,7 @@ const _keras_hub_causal_lm = (modelId) => `
425
425
  import keras_hub
426
426
 
427
427
  # Load CausalLM model (optional: use half precision for inference)
428
- causal_lm = keras_hub.models.CausalLM.from_preset("${modelId}", dtype="bfloat16")
428
+ causal_lm = keras_hub.models.CausalLM.from_preset("hf://${modelId}", dtype="bfloat16")
429
429
  causal_lm.compile(sampler="greedy") # (optional) specify a sampler
430
430
 
431
431
  # Generate text
@@ -435,7 +435,7 @@ const _keras_hub_text_to_image = (modelId) => `
435
435
  import keras_hub
436
436
 
437
437
  # Load TextToImage model (optional: use half precision for inference)
438
- text_to_image = keras_hub.models.TextToImage.from_preset("${modelId}", dtype="bfloat16")
438
+ text_to_image = keras_hub.models.TextToImage.from_preset("hf://${modelId}", dtype="bfloat16")
439
439
 
440
440
  # Generate images with a TextToImage model.
441
441
  text_to_image.generate("Astronaut in a jungle")
@@ -445,7 +445,7 @@ import keras_hub
445
445
 
446
446
  # Load TextClassifier model
447
447
  text_classifier = keras_hub.models.TextClassifier.from_preset(
448
- "${modelId}",
448
+ "hf://${modelId}",
449
449
  num_classes=2,
450
450
  )
451
451
  # Fine-tune
@@ -459,7 +459,7 @@ import keras
459
459
 
460
460
  # Load ImageClassifier model
461
461
  image_classifier = keras_hub.models.ImageClassifier.from_preset(
462
- "${modelId}",
462
+ "hf://${modelId}",
463
463
  num_classes=2,
464
464
  )
465
465
  # Fine-tune
@@ -480,13 +480,13 @@ const _keras_hub_task_without_example = (task, modelId) => `
480
480
  import keras_hub
481
481
 
482
482
  # Create a ${task} model
483
- task = keras_hub.models.${task}.from_preset("${modelId}")
483
+ task = keras_hub.models.${task}.from_preset("hf://${modelId}")
484
484
  `;
485
485
  const _keras_hub_generic_backbone = (modelId) => `
486
486
  import keras_hub
487
487
 
488
488
  # Create a Backbone model unspecialized for any task
489
- backbone = keras_hub.models.Backbone.from_preset("${modelId}")
489
+ backbone = keras_hub.models.Backbone.from_preset("hf://${modelId}")
490
490
  `;
491
491
  const keras_hub = (model) => {
492
492
  const modelId = model.id;
@@ -1137,7 +1137,7 @@ exports.birefnet = birefnet;
1137
1137
  const swarmformer = (model) => [
1138
1138
  `from swarmformer import SwarmFormerModel
1139
1139
 
1140
- model = SwarmFormerModel.from_pretrained("${model.id}", trust_remote_code=True)
1140
+ model = SwarmFormerModel.from_pretrained("${model.id}")
1141
1141
  `,
1142
1142
  ];
1143
1143
  exports.swarmformer = swarmformer;
@@ -145,7 +145,7 @@ export interface AutomaticSpeechRecognitionOutputChunk {
145
145
  /**
146
146
  * The start and end timestamps corresponding with the text
147
147
  */
148
- timestamps: number[];
148
+ timestamp: number[];
149
149
  [property: string]: unknown;
150
150
  }
151
151
  //# sourceMappingURL=inference.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"inference.d.ts","sourceRoot":"","sources":["../../../../src/tasks/automatic-speech-recognition/inference.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH;;GAEG;AACH,MAAM,WAAW,+BAA+B;IAC/C;;;OAGG;IACH,MAAM,EAAE,IAAI,CAAC;IACb;;OAEG;IACH,UAAU,CAAC,EAAE,oCAAoC,CAAC;IAClD,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD;;GAEG;AACH,MAAM,WAAW,oCAAoC;IACpD;;OAEG;IACH,qBAAqB,CAAC,EAAE,oBAAoB,CAAC;IAC7C;;OAEG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACpC;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,cAAc,CAAC,EAAE,kBAAkB,CAAC;IACpC;;;;;OAKG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;;;;;;;OAQG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;;;OAMG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,OAAO,GAAG,OAAO,CAAC;AACnD;;GAEG;AACH,MAAM,WAAW,gCAAgC;IAChD;;;OAGG;IACH,MAAM,CAAC,EAAE,qCAAqC,EAAE,CAAC;IACjD;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD,MAAM,WAAW,qCAAqC;IACrD;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B"}
1
+ {"version":3,"file":"inference.d.ts","sourceRoot":"","sources":["../../../../src/tasks/automatic-speech-recognition/inference.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH;;GAEG;AACH,MAAM,WAAW,+BAA+B;IAC/C;;;OAGG;IACH,MAAM,EAAE,IAAI,CAAC;IACb;;OAEG;IACH,UAAU,CAAC,EAAE,oCAAoC,CAAC;IAClD,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD;;GAEG;AACH,MAAM,WAAW,oCAAoC;IACpD;;OAEG;IACH,qBAAqB,CAAC,EAAE,oBAAoB,CAAC;IAC7C;;OAEG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACpC;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,cAAc,CAAC,EAAE,kBAAkB,CAAC;IACpC;;;;;OAKG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;;;;;;;OAQG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;;;OAMG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,OAAO,GAAG,OAAO,CAAC;AACnD;;GAEG;AACH,MAAM,WAAW,gCAAgC;IAChD;;;OAGG;IACH,MAAM,CAAC,EAAE,qCAAqC,EAAE,CAAC;IACjD;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD,MAAM,WAAW,qCAAqC;IACrD;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B"}
@@ -13,9 +13,9 @@ export type FeatureExtractionOutput = Array<number[]>;
13
13
  */
14
14
  export interface FeatureExtractionInput {
15
15
  /**
16
- * The text to embed.
16
+ * The text or list of texts to embed.
17
17
  */
18
- inputs: string;
18
+ inputs: FeatureExtractionInputs;
19
19
  normalize?: boolean;
20
20
  /**
21
21
  * The name of the prompt that should be used by for encoding. If not set, no prompt
@@ -34,5 +34,9 @@ export interface FeatureExtractionInput {
34
34
  truncation_direction?: FeatureExtractionInputTruncationDirection;
35
35
  [property: string]: unknown;
36
36
  }
37
+ /**
38
+ * The text or list of texts to embed.
39
+ */
40
+ export type FeatureExtractionInputs = string[] | string;
37
41
  export type FeatureExtractionInputTruncationDirection = "Left" | "Right";
38
42
  //# sourceMappingURL=inference.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"inference.d.ts","sourceRoot":"","sources":["../../../../src/tasks/feature-extraction/inference.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,MAAM,uBAAuB,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC;AACtD;;;;;;GAMG;AACH,MAAM,WAAW,sBAAsB;IACtC;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;;;;;;;;;OAWG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,oBAAoB,CAAC,EAAE,yCAAyC,CAAC;IACjE,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD,MAAM,MAAM,yCAAyC,GAAG,MAAM,GAAG,OAAO,CAAC"}
1
+ {"version":3,"file":"inference.d.ts","sourceRoot":"","sources":["../../../../src/tasks/feature-extraction/inference.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,MAAM,uBAAuB,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC;AACtD;;;;;;GAMG;AACH,MAAM,WAAW,sBAAsB;IACtC;;OAEG;IACH,MAAM,EAAE,uBAAuB,CAAC;IAChC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;;;;;;;;;OAWG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,oBAAoB,CAAC,EAAE,yCAAyC,CAAC;IACjE,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD;;GAEG;AACH,MAAM,MAAM,uBAAuB,GAAG,MAAM,EAAE,GAAG,MAAM,CAAC;AACxD,MAAM,MAAM,yCAAyC,GAAG,MAAM,GAAG,OAAO,CAAC"}
@@ -59,7 +59,7 @@ const taskData = {
59
59
  },
60
60
  {
61
61
  description: "Strong image-text-to-text model.",
62
- id: "Qwen/Qwen2-VL-7B-Instruct",
62
+ id: "Qwen/Qwen2.5-VL-7B-Instruct",
63
63
  },
64
64
  {
65
65
  description: "Image-text-to-text model with reasoning capabilities.",
@@ -97,11 +97,11 @@ const taskData = {
97
97
  },
98
98
  {
99
99
  description: "An application that detects gaze.",
100
- id: "smoondream/gaze-demo",
100
+ id: "moondream/gaze-demo",
101
101
  },
102
102
  ],
103
103
  summary: "Image-text-to-text models take in an image and text prompt and output text. These models are also called vision-language models, or VLMs. The difference from image-to-text models is that these models take an additional text input, not restricting the model to certain use cases like image captioning, and may also be trained to accept a conversation as input.",
104
- widgetModels: ["meta-llama/Llama-3.2-11B-Vision-Instruct"],
104
+ widgetModels: ["Qwen/Qwen2-VL-7B-Instruct"],
105
105
  youtubeId: "IoGaGfU1CIg",
106
106
  };
107
107
  exports.default = taskData;
@@ -1 +1 @@
1
- {"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../../../src/tasks/text-generation/data.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,QAAA,MAAM,QAAQ,EAAE,cAgHf,CAAC;AAEF,eAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../../../src/tasks/text-generation/data.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,QAAA,MAAM,QAAQ,EAAE,cA2Hf,CAAC;AAEF,eAAe,QAAQ,CAAC"}
@@ -14,6 +14,10 @@ const taskData = {
14
14
  description: "Truly open-source, curated and cleaned dialogue dataset.",
15
15
  id: "HuggingFaceH4/ultrachat_200k",
16
16
  },
17
+ {
18
+ description: "A reasoning dataset.",
19
+ id: "open-r1/OpenThoughts-114k-math",
20
+ },
17
21
  {
18
22
  description: "A multilingual instruction dataset with preference ratings on responses.",
19
23
  id: "allenai/tulu-3-sft-mixture",
@@ -54,10 +58,13 @@ const taskData = {
54
58
  },
55
59
  ],
56
60
  models: [
57
- {
58
- description: "A text-generation model trained to follow instructions.",
61
+ { description: "A text-generation model trained to follow instructions.",
59
62
  id: "google/gemma-2-2b-it",
60
63
  },
64
+ {
65
+ description: "Smaller variant of one of the most powerful models.",
66
+ id: "deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B",
67
+ },
61
68
  {
62
69
  description: "Very powerful text generation model trained to follow instructions.",
63
70
  id: "meta-llama/Meta-Llama-3.1-8B-Instruct",
@@ -71,13 +78,17 @@ const taskData = {
71
78
  id: "PowerInfer/SmallThinker-3B-Preview",
72
79
  },
73
80
  {
74
- description: "Strong text generation model to follow instructions.",
75
- id: "Qwen/Qwen2.5-7B-Instruct",
81
+ description: "Strong conversational model that supports very long instructions.",
82
+ id: "Qwen/Qwen2.5-7B-Instruct-1M",
76
83
  },
77
84
  {
78
85
  description: "Text generation model used to write code.",
79
86
  id: "Qwen/Qwen2.5-Coder-32B-Instruct",
80
87
  },
88
+ {
89
+ description: "Powerful reasoning based open large language model.",
90
+ id: "deepseek-ai/DeepSeek-R1",
91
+ },
81
92
  ],
82
93
  spaces: [
83
94
  {
@@ -26,6 +26,10 @@ export interface TextToImageParameters {
26
26
  * the text prompt, but values too high may cause saturation and other artifacts.
27
27
  */
28
28
  guidance_scale?: number;
29
+ /**
30
+ * The height in pixels of the output image
31
+ */
32
+ height?: number;
29
33
  /**
30
34
  * One prompt to guide what NOT to include in image generation.
31
35
  */
@@ -44,17 +48,9 @@ export interface TextToImageParameters {
44
48
  */
45
49
  seed?: number;
46
50
  /**
47
- * The size in pixel of the output image
51
+ * The width in pixels of the output image
48
52
  */
49
- target_size?: TargetSize;
50
- [property: string]: unknown;
51
- }
52
- /**
53
- * The size in pixel of the output image
54
- */
55
- export interface TargetSize {
56
- height: number;
57
- width: number;
53
+ width?: number;
58
54
  [property: string]: unknown;
59
55
  }
60
56
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"inference.d.ts","sourceRoot":"","sources":["../../../../src/tasks/text-to-image/inference.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAChC;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,UAAU,CAAC,EAAE,qBAAqB,CAAC;IACnC,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACrC;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;;OAGG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,WAAW,CAAC,EAAE,UAAU,CAAC;IACzB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD;;GAEG;AACH,MAAM,WAAW,UAAU;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD;;GAEG;AACH,MAAM,WAAW,iBAAiB;IACjC;;OAEG;IACH,KAAK,EAAE,OAAO,CAAC;IACf,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B"}
1
+ {"version":3,"file":"inference.d.ts","sourceRoot":"","sources":["../../../../src/tasks/text-to-image/inference.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAChC;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,UAAU,CAAC,EAAE,qBAAqB,CAAC;IACnC,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACrC;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;;OAGG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD;;GAEG;AACH,MAAM,WAAW,iBAAiB;IACjC;;OAEG;IACH,KAAK,EAAE,OAAO,CAAC;IACf,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B"}
@@ -1,6 +1,6 @@
1
1
  /**
2
- * Biden AI Executive Order
3
- * https://www.whitehouse.gov/briefing-room/presidential-actions/2023/10/30/executive-order-on-the-safe-secure-and-trustworthy-development-and-use-of-artificial-intelligence/
2
+ * Biden AI Executive Order (since revoked by President Trump):
3
+ * https://web.archive.org/web/20250105222429/https://www.whitehouse.gov/briefing-room/presidential-actions/2023/10/30/executive-order-on-the-safe-secure-and-trustworthy-development-and-use-of-artificial-intelligence/
4
4
  */
5
5
  export declare const TFLOPS_THRESHOLD_WHITE_HOUSE_MODEL_TRAINING_TOTAL: number;
6
6
  export declare const TFLOPS_THRESHOLD_WHITE_HOUSE_MODEL_TRAINING_TOTAL_BIOLOGY: number;
@@ -1,6 +1,6 @@
1
1
  /**
2
- * Biden AI Executive Order
3
- * https://www.whitehouse.gov/briefing-room/presidential-actions/2023/10/30/executive-order-on-the-safe-secure-and-trustworthy-development-and-use-of-artificial-intelligence/
2
+ * Biden AI Executive Order (since revoked by President Trump):
3
+ * https://web.archive.org/web/20250105222429/https://www.whitehouse.gov/briefing-room/presidential-actions/2023/10/30/executive-order-on-the-safe-secure-and-trustworthy-development-and-use-of-artificial-intelligence/
4
4
  */
5
5
  export const TFLOPS_THRESHOLD_WHITE_HOUSE_MODEL_TRAINING_TOTAL = 10 ** 14;
6
6
  export const TFLOPS_THRESHOLD_WHITE_HOUSE_MODEL_TRAINING_TOTAL_BIOLOGY = 10 ** 11;
@@ -1 +1 @@
1
- {"version":3,"file":"library-to-tasks.d.ts","sourceRoot":"","sources":["../../src/library-to-tasks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEnD;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,EAAE,OAAO,CAAC,MAAM,CAAC,eAAe,EAAE,YAAY,EAAE,CAAC,CAmEjF,CAAC"}
1
+ {"version":3,"file":"library-to-tasks.d.ts","sourceRoot":"","sources":["../../src/library-to-tasks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEnD;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,EAAE,OAAO,CAAC,MAAM,CAAC,eAAe,EAAE,YAAY,EAAE,CAAC,CAoEjF,CAAC"}
@@ -40,7 +40,7 @@ export const LIBRARY_TASK_MAPPING = {
40
40
  "text2text-generation",
41
41
  ],
42
42
  stanza: ["token-classification"],
43
- timm: ["image-classification"],
43
+ timm: ["image-classification", "image-feature-extraction"],
44
44
  transformers: [
45
45
  "audio-classification",
46
46
  "automatic-speech-recognition",
@@ -49,6 +49,7 @@ export const LIBRARY_TASK_MAPPING = {
49
49
  "feature-extraction",
50
50
  "fill-mask",
51
51
  "image-classification",
52
+ "image-feature-extraction",
52
53
  "image-segmentation",
53
54
  "image-to-image",
54
55
  "image-to-text",
@@ -398,7 +398,7 @@ const _keras_hub_causal_lm = (modelId) => `
398
398
  import keras_hub
399
399
 
400
400
  # Load CausalLM model (optional: use half precision for inference)
401
- causal_lm = keras_hub.models.CausalLM.from_preset("${modelId}", dtype="bfloat16")
401
+ causal_lm = keras_hub.models.CausalLM.from_preset("hf://${modelId}", dtype="bfloat16")
402
402
  causal_lm.compile(sampler="greedy") # (optional) specify a sampler
403
403
 
404
404
  # Generate text
@@ -408,7 +408,7 @@ const _keras_hub_text_to_image = (modelId) => `
408
408
  import keras_hub
409
409
 
410
410
  # Load TextToImage model (optional: use half precision for inference)
411
- text_to_image = keras_hub.models.TextToImage.from_preset("${modelId}", dtype="bfloat16")
411
+ text_to_image = keras_hub.models.TextToImage.from_preset("hf://${modelId}", dtype="bfloat16")
412
412
 
413
413
  # Generate images with a TextToImage model.
414
414
  text_to_image.generate("Astronaut in a jungle")
@@ -418,7 +418,7 @@ import keras_hub
418
418
 
419
419
  # Load TextClassifier model
420
420
  text_classifier = keras_hub.models.TextClassifier.from_preset(
421
- "${modelId}",
421
+ "hf://${modelId}",
422
422
  num_classes=2,
423
423
  )
424
424
  # Fine-tune
@@ -432,7 +432,7 @@ import keras
432
432
 
433
433
  # Load ImageClassifier model
434
434
  image_classifier = keras_hub.models.ImageClassifier.from_preset(
435
- "${modelId}",
435
+ "hf://${modelId}",
436
436
  num_classes=2,
437
437
  )
438
438
  # Fine-tune
@@ -453,13 +453,13 @@ const _keras_hub_task_without_example = (task, modelId) => `
453
453
  import keras_hub
454
454
 
455
455
  # Create a ${task} model
456
- task = keras_hub.models.${task}.from_preset("${modelId}")
456
+ task = keras_hub.models.${task}.from_preset("hf://${modelId}")
457
457
  `;
458
458
  const _keras_hub_generic_backbone = (modelId) => `
459
459
  import keras_hub
460
460
 
461
461
  # Create a Backbone model unspecialized for any task
462
- backbone = keras_hub.models.Backbone.from_preset("${modelId}")
462
+ backbone = keras_hub.models.Backbone.from_preset("hf://${modelId}")
463
463
  `;
464
464
  export const keras_hub = (model) => {
465
465
  const modelId = model.id;
@@ -1070,7 +1070,7 @@ model = BiRefNet.from_pretrained("${model.id}")`,
1070
1070
  export const swarmformer = (model) => [
1071
1071
  `from swarmformer import SwarmFormerModel
1072
1072
 
1073
- model = SwarmFormerModel.from_pretrained("${model.id}", trust_remote_code=True)
1073
+ model = SwarmFormerModel.from_pretrained("${model.id}")
1074
1074
  `,
1075
1075
  ];
1076
1076
  export const mlx = (model) => [
@@ -145,7 +145,7 @@ export interface AutomaticSpeechRecognitionOutputChunk {
145
145
  /**
146
146
  * The start and end timestamps corresponding with the text
147
147
  */
148
- timestamps: number[];
148
+ timestamp: number[];
149
149
  [property: string]: unknown;
150
150
  }
151
151
  //# sourceMappingURL=inference.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"inference.d.ts","sourceRoot":"","sources":["../../../../src/tasks/automatic-speech-recognition/inference.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH;;GAEG;AACH,MAAM,WAAW,+BAA+B;IAC/C;;;OAGG;IACH,MAAM,EAAE,IAAI,CAAC;IACb;;OAEG;IACH,UAAU,CAAC,EAAE,oCAAoC,CAAC;IAClD,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD;;GAEG;AACH,MAAM,WAAW,oCAAoC;IACpD;;OAEG;IACH,qBAAqB,CAAC,EAAE,oBAAoB,CAAC;IAC7C;;OAEG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACpC;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,cAAc,CAAC,EAAE,kBAAkB,CAAC;IACpC;;;;;OAKG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;;;;;;;OAQG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;;;OAMG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,OAAO,GAAG,OAAO,CAAC;AACnD;;GAEG;AACH,MAAM,WAAW,gCAAgC;IAChD;;;OAGG;IACH,MAAM,CAAC,EAAE,qCAAqC,EAAE,CAAC;IACjD;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD,MAAM,WAAW,qCAAqC;IACrD;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B"}
1
+ {"version":3,"file":"inference.d.ts","sourceRoot":"","sources":["../../../../src/tasks/automatic-speech-recognition/inference.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH;;GAEG;AACH,MAAM,WAAW,+BAA+B;IAC/C;;;OAGG;IACH,MAAM,EAAE,IAAI,CAAC;IACb;;OAEG;IACH,UAAU,CAAC,EAAE,oCAAoC,CAAC;IAClD,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD;;GAEG;AACH,MAAM,WAAW,oCAAoC;IACpD;;OAEG;IACH,qBAAqB,CAAC,EAAE,oBAAoB,CAAC;IAC7C;;OAEG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACpC;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,cAAc,CAAC,EAAE,kBAAkB,CAAC;IACpC;;;;;OAKG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;;;;;;;OAQG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;;;OAMG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,OAAO,GAAG,OAAO,CAAC;AACnD;;GAEG;AACH,MAAM,WAAW,gCAAgC;IAChD;;;OAGG;IACH,MAAM,CAAC,EAAE,qCAAqC,EAAE,CAAC;IACjD;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD,MAAM,WAAW,qCAAqC;IACrD;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B"}
@@ -13,9 +13,9 @@ export type FeatureExtractionOutput = Array<number[]>;
13
13
  */
14
14
  export interface FeatureExtractionInput {
15
15
  /**
16
- * The text to embed.
16
+ * The text or list of texts to embed.
17
17
  */
18
- inputs: string;
18
+ inputs: FeatureExtractionInputs;
19
19
  normalize?: boolean;
20
20
  /**
21
21
  * The name of the prompt that should be used by for encoding. If not set, no prompt
@@ -34,5 +34,9 @@ export interface FeatureExtractionInput {
34
34
  truncation_direction?: FeatureExtractionInputTruncationDirection;
35
35
  [property: string]: unknown;
36
36
  }
37
+ /**
38
+ * The text or list of texts to embed.
39
+ */
40
+ export type FeatureExtractionInputs = string[] | string;
37
41
  export type FeatureExtractionInputTruncationDirection = "Left" | "Right";
38
42
  //# sourceMappingURL=inference.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"inference.d.ts","sourceRoot":"","sources":["../../../../src/tasks/feature-extraction/inference.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,MAAM,uBAAuB,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC;AACtD;;;;;;GAMG;AACH,MAAM,WAAW,sBAAsB;IACtC;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;;;;;;;;;OAWG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,oBAAoB,CAAC,EAAE,yCAAyC,CAAC;IACjE,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD,MAAM,MAAM,yCAAyC,GAAG,MAAM,GAAG,OAAO,CAAC"}
1
+ {"version":3,"file":"inference.d.ts","sourceRoot":"","sources":["../../../../src/tasks/feature-extraction/inference.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,MAAM,uBAAuB,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC;AACtD;;;;;;GAMG;AACH,MAAM,WAAW,sBAAsB;IACtC;;OAEG;IACH,MAAM,EAAE,uBAAuB,CAAC;IAChC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;;;;;;;;;OAWG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,oBAAoB,CAAC,EAAE,yCAAyC,CAAC;IACjE,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD;;GAEG;AACH,MAAM,MAAM,uBAAuB,GAAG,MAAM,EAAE,GAAG,MAAM,CAAC;AACxD,MAAM,MAAM,yCAAyC,GAAG,MAAM,GAAG,OAAO,CAAC"}
@@ -57,7 +57,7 @@ const taskData = {
57
57
  },
58
58
  {
59
59
  description: "Strong image-text-to-text model.",
60
- id: "Qwen/Qwen2-VL-7B-Instruct",
60
+ id: "Qwen/Qwen2.5-VL-7B-Instruct",
61
61
  },
62
62
  {
63
63
  description: "Image-text-to-text model with reasoning capabilities.",
@@ -95,11 +95,11 @@ const taskData = {
95
95
  },
96
96
  {
97
97
  description: "An application that detects gaze.",
98
- id: "smoondream/gaze-demo",
98
+ id: "moondream/gaze-demo",
99
99
  },
100
100
  ],
101
101
  summary: "Image-text-to-text models take in an image and text prompt and output text. These models are also called vision-language models, or VLMs. The difference from image-to-text models is that these models take an additional text input, not restricting the model to certain use cases like image captioning, and may also be trained to accept a conversation as input.",
102
- widgetModels: ["meta-llama/Llama-3.2-11B-Vision-Instruct"],
102
+ widgetModels: ["Qwen/Qwen2-VL-7B-Instruct"],
103
103
  youtubeId: "IoGaGfU1CIg",
104
104
  };
105
105
  export default taskData;
@@ -1 +1 @@
1
- {"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../../../src/tasks/text-generation/data.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,QAAA,MAAM,QAAQ,EAAE,cAgHf,CAAC;AAEF,eAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../../../src/tasks/text-generation/data.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,QAAA,MAAM,QAAQ,EAAE,cA2Hf,CAAC;AAEF,eAAe,QAAQ,CAAC"}
@@ -12,6 +12,10 @@ const taskData = {
12
12
  description: "Truly open-source, curated and cleaned dialogue dataset.",
13
13
  id: "HuggingFaceH4/ultrachat_200k",
14
14
  },
15
+ {
16
+ description: "A reasoning dataset.",
17
+ id: "open-r1/OpenThoughts-114k-math",
18
+ },
15
19
  {
16
20
  description: "A multilingual instruction dataset with preference ratings on responses.",
17
21
  id: "allenai/tulu-3-sft-mixture",
@@ -52,10 +56,13 @@ const taskData = {
52
56
  },
53
57
  ],
54
58
  models: [
55
- {
56
- description: "A text-generation model trained to follow instructions.",
59
+ { description: "A text-generation model trained to follow instructions.",
57
60
  id: "google/gemma-2-2b-it",
58
61
  },
62
+ {
63
+ description: "Smaller variant of one of the most powerful models.",
64
+ id: "deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B",
65
+ },
59
66
  {
60
67
  description: "Very powerful text generation model trained to follow instructions.",
61
68
  id: "meta-llama/Meta-Llama-3.1-8B-Instruct",
@@ -69,13 +76,17 @@ const taskData = {
69
76
  id: "PowerInfer/SmallThinker-3B-Preview",
70
77
  },
71
78
  {
72
- description: "Strong text generation model to follow instructions.",
73
- id: "Qwen/Qwen2.5-7B-Instruct",
79
+ description: "Strong conversational model that supports very long instructions.",
80
+ id: "Qwen/Qwen2.5-7B-Instruct-1M",
74
81
  },
75
82
  {
76
83
  description: "Text generation model used to write code.",
77
84
  id: "Qwen/Qwen2.5-Coder-32B-Instruct",
78
85
  },
86
+ {
87
+ description: "Powerful reasoning based open large language model.",
88
+ id: "deepseek-ai/DeepSeek-R1",
89
+ },
79
90
  ],
80
91
  spaces: [
81
92
  {
@@ -26,6 +26,10 @@ export interface TextToImageParameters {
26
26
  * the text prompt, but values too high may cause saturation and other artifacts.
27
27
  */
28
28
  guidance_scale?: number;
29
+ /**
30
+ * The height in pixels of the output image
31
+ */
32
+ height?: number;
29
33
  /**
30
34
  * One prompt to guide what NOT to include in image generation.
31
35
  */
@@ -44,17 +48,9 @@ export interface TextToImageParameters {
44
48
  */
45
49
  seed?: number;
46
50
  /**
47
- * The size in pixel of the output image
51
+ * The width in pixels of the output image
48
52
  */
49
- target_size?: TargetSize;
50
- [property: string]: unknown;
51
- }
52
- /**
53
- * The size in pixel of the output image
54
- */
55
- export interface TargetSize {
56
- height: number;
57
- width: number;
53
+ width?: number;
58
54
  [property: string]: unknown;
59
55
  }
60
56
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"inference.d.ts","sourceRoot":"","sources":["../../../../src/tasks/text-to-image/inference.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAChC;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,UAAU,CAAC,EAAE,qBAAqB,CAAC;IACnC,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACrC;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;;OAGG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,WAAW,CAAC,EAAE,UAAU,CAAC;IACzB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD;;GAEG;AACH,MAAM,WAAW,UAAU;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD;;GAEG;AACH,MAAM,WAAW,iBAAiB;IACjC;;OAEG;IACH,KAAK,EAAE,OAAO,CAAC;IACf,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B"}
1
+ {"version":3,"file":"inference.d.ts","sourceRoot":"","sources":["../../../../src/tasks/text-to-image/inference.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAChC;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,UAAU,CAAC,EAAE,qBAAqB,CAAC;IACnC,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACrC;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;;OAGG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD;;GAEG;AACH,MAAM,WAAW,iBAAiB;IACjC;;OAEG;IACH,KAAK,EAAE,OAAO,CAAC;IACf,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B"}
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.15.6",
4
+ "version": "0.15.8",
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/hardware.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
- * Biden AI Executive Order
3
- * https://www.whitehouse.gov/briefing-room/presidential-actions/2023/10/30/executive-order-on-the-safe-secure-and-trustworthy-development-and-use-of-artificial-intelligence/
2
+ * Biden AI Executive Order (since revoked by President Trump):
3
+ * https://web.archive.org/web/20250105222429/https://www.whitehouse.gov/briefing-room/presidential-actions/2023/10/30/executive-order-on-the-safe-secure-and-trustworthy-development-and-use-of-artificial-intelligence/
4
4
  */
5
5
  export const TFLOPS_THRESHOLD_WHITE_HOUSE_MODEL_TRAINING_TOTAL = 10 ** 14;
6
6
  export const TFLOPS_THRESHOLD_WHITE_HOUSE_MODEL_TRAINING_TOTAL_BIOLOGY = 10 ** 11;
@@ -43,7 +43,7 @@ export const LIBRARY_TASK_MAPPING: Partial<Record<ModelLibraryKey, PipelineType[
43
43
  "text2text-generation",
44
44
  ],
45
45
  stanza: ["token-classification"],
46
- timm: ["image-classification"],
46
+ timm: ["image-classification", "image-feature-extraction"],
47
47
  transformers: [
48
48
  "audio-classification",
49
49
  "automatic-speech-recognition",
@@ -52,6 +52,7 @@ export const LIBRARY_TASK_MAPPING: Partial<Record<ModelLibraryKey, PipelineType[
52
52
  "feature-extraction",
53
53
  "fill-mask",
54
54
  "image-classification",
55
+ "image-feature-extraction",
55
56
  "image-segmentation",
56
57
  "image-to-image",
57
58
  "image-to-text",
@@ -443,7 +443,7 @@ const _keras_hub_causal_lm = (modelId: string): string => `
443
443
  import keras_hub
444
444
 
445
445
  # Load CausalLM model (optional: use half precision for inference)
446
- causal_lm = keras_hub.models.CausalLM.from_preset("${modelId}", dtype="bfloat16")
446
+ causal_lm = keras_hub.models.CausalLM.from_preset("hf://${modelId}", dtype="bfloat16")
447
447
  causal_lm.compile(sampler="greedy") # (optional) specify a sampler
448
448
 
449
449
  # Generate text
@@ -454,7 +454,7 @@ const _keras_hub_text_to_image = (modelId: string): string => `
454
454
  import keras_hub
455
455
 
456
456
  # Load TextToImage model (optional: use half precision for inference)
457
- text_to_image = keras_hub.models.TextToImage.from_preset("${modelId}", dtype="bfloat16")
457
+ text_to_image = keras_hub.models.TextToImage.from_preset("hf://${modelId}", dtype="bfloat16")
458
458
 
459
459
  # Generate images with a TextToImage model.
460
460
  text_to_image.generate("Astronaut in a jungle")
@@ -465,7 +465,7 @@ import keras_hub
465
465
 
466
466
  # Load TextClassifier model
467
467
  text_classifier = keras_hub.models.TextClassifier.from_preset(
468
- "${modelId}",
468
+ "hf://${modelId}",
469
469
  num_classes=2,
470
470
  )
471
471
  # Fine-tune
@@ -480,7 +480,7 @@ import keras
480
480
 
481
481
  # Load ImageClassifier model
482
482
  image_classifier = keras_hub.models.ImageClassifier.from_preset(
483
- "${modelId}",
483
+ "hf://${modelId}",
484
484
  num_classes=2,
485
485
  )
486
486
  # Fine-tune
@@ -503,14 +503,14 @@ const _keras_hub_task_without_example = (task: string, modelId: string): string
503
503
  import keras_hub
504
504
 
505
505
  # Create a ${task} model
506
- task = keras_hub.models.${task}.from_preset("${modelId}")
506
+ task = keras_hub.models.${task}.from_preset("hf://${modelId}")
507
507
  `;
508
508
 
509
509
  const _keras_hub_generic_backbone = (modelId: string): string => `
510
510
  import keras_hub
511
511
 
512
512
  # Create a Backbone model unspecialized for any task
513
- backbone = keras_hub.models.Backbone.from_preset("${modelId}")
513
+ backbone = keras_hub.models.Backbone.from_preset("hf://${modelId}")
514
514
  `;
515
515
 
516
516
  export const keras_hub = (model: ModelData): string[] => {
@@ -1186,7 +1186,7 @@ model = BiRefNet.from_pretrained("${model.id}")`,
1186
1186
  export const swarmformer = (model: ModelData): string[] => [
1187
1187
  `from swarmformer import SwarmFormerModel
1188
1188
 
1189
- model = SwarmFormerModel.from_pretrained("${model.id}", trust_remote_code=True)
1189
+ model = SwarmFormerModel.from_pretrained("${model.id}")
1190
1190
  `,
1191
1191
  ];
1192
1192
 
@@ -145,6 +145,6 @@ export interface AutomaticSpeechRecognitionOutputChunk {
145
145
  /**
146
146
  * The start and end timestamps corresponding with the text
147
147
  */
148
- timestamps: number[];
148
+ timestamp: number[];
149
149
  [property: string]: unknown;
150
150
  }
@@ -20,7 +20,7 @@
20
20
  "type": "string",
21
21
  "description": "A chunk of text identified by the model"
22
22
  },
23
- "timestamps": {
23
+ "timestamp": {
24
24
  "type": "array",
25
25
  "description": "The start and end timestamps corresponding with the text",
26
26
  "items": {
@@ -30,7 +30,7 @@
30
30
  "maxLength": 2
31
31
  }
32
32
  },
33
- "required": ["text", "timestamps"]
33
+ "required": ["text", "timestamp"]
34
34
  }
35
35
  }
36
36
  },
@@ -13,9 +13,9 @@ export type FeatureExtractionOutput = Array<number[]>;
13
13
  */
14
14
  export interface FeatureExtractionInput {
15
15
  /**
16
- * The text to embed.
16
+ * The text or list of texts to embed.
17
17
  */
18
- inputs: string;
18
+ inputs: FeatureExtractionInputs;
19
19
  normalize?: boolean;
20
20
  /**
21
21
  * The name of the prompt that should be used by for encoding. If not set, no prompt
@@ -34,4 +34,8 @@ export interface FeatureExtractionInput {
34
34
  truncation_direction?: FeatureExtractionInputTruncationDirection;
35
35
  [property: string]: unknown;
36
36
  }
37
+ /**
38
+ * The text or list of texts to embed.
39
+ */
40
+ export type FeatureExtractionInputs = string[] | string;
37
41
  export type FeatureExtractionInputTruncationDirection = "Left" | "Right";
@@ -7,8 +7,12 @@
7
7
  "required": ["inputs"],
8
8
  "properties": {
9
9
  "inputs": {
10
- "type": "string",
11
- "description": "The text to embed."
10
+ "title": "FeatureExtractionInputs",
11
+ "oneOf": [
12
+ { "type": "string" },
13
+ { "type": "array", "items": { "type": "string" } }
14
+ ],
15
+ "description": "The text or list of texts to embed."
12
16
  },
13
17
  "normalize": {
14
18
  "type": "boolean",
@@ -60,7 +60,7 @@ const taskData: TaskDataCustom = {
60
60
  },
61
61
  {
62
62
  description: "Strong image-text-to-text model.",
63
- id: "Qwen/Qwen2-VL-7B-Instruct",
63
+ id: "Qwen/Qwen2.5-VL-7B-Instruct",
64
64
  },
65
65
  {
66
66
  description: "Image-text-to-text model with reasoning capabilities.",
@@ -98,12 +98,12 @@ const taskData: TaskDataCustom = {
98
98
  },
99
99
  {
100
100
  description: "An application that detects gaze.",
101
- id: "smoondream/gaze-demo",
101
+ id: "moondream/gaze-demo",
102
102
  },
103
103
  ],
104
104
  summary:
105
105
  "Image-text-to-text models take in an image and text prompt and output text. These models are also called vision-language models, or VLMs. The difference from image-to-text models is that these models take an additional text input, not restricting the model to certain use cases like image captioning, and may also be trained to accept a conversation as input.",
106
- widgetModels: ["meta-llama/Llama-3.2-11B-Vision-Instruct"],
106
+ widgetModels: ["Qwen/Qwen2-VL-7B-Instruct"],
107
107
  youtubeId: "IoGaGfU1CIg",
108
108
  };
109
109
 
@@ -14,6 +14,10 @@ const taskData: TaskDataCustom = {
14
14
  description: "Truly open-source, curated and cleaned dialogue dataset.",
15
15
  id: "HuggingFaceH4/ultrachat_200k",
16
16
  },
17
+ {
18
+ description: "A reasoning dataset.",
19
+ id: "open-r1/OpenThoughts-114k-math",
20
+ },
17
21
  {
18
22
  description: "A multilingual instruction dataset with preference ratings on responses.",
19
23
  id: "allenai/tulu-3-sft-mixture",
@@ -57,10 +61,13 @@ const taskData: TaskDataCustom = {
57
61
  },
58
62
  ],
59
63
  models: [
60
- {
61
- description: "A text-generation model trained to follow instructions.",
64
+ { description: "A text-generation model trained to follow instructions.",
62
65
  id: "google/gemma-2-2b-it",
63
66
  },
67
+ {
68
+ description: "Smaller variant of one of the most powerful models.",
69
+ id: "deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B",
70
+ },
64
71
  {
65
72
  description: "Very powerful text generation model trained to follow instructions.",
66
73
  id: "meta-llama/Meta-Llama-3.1-8B-Instruct",
@@ -74,13 +81,17 @@ const taskData: TaskDataCustom = {
74
81
  id: "PowerInfer/SmallThinker-3B-Preview",
75
82
  },
76
83
  {
77
- description: "Strong text generation model to follow instructions.",
78
- id: "Qwen/Qwen2.5-7B-Instruct",
84
+ description: "Strong conversational model that supports very long instructions.",
85
+ id: "Qwen/Qwen2.5-7B-Instruct-1M",
79
86
  },
80
87
  {
81
88
  description: "Text generation model used to write code.",
82
89
  id: "Qwen/Qwen2.5-Coder-32B-Instruct",
83
90
  },
91
+ {
92
+ description: "Powerful reasoning based open large language model.",
93
+ id: "deepseek-ai/DeepSeek-R1",
94
+ },
84
95
  ],
85
96
  spaces: [
86
97
  {
@@ -26,6 +26,10 @@ export interface TextToImageParameters {
26
26
  * the text prompt, but values too high may cause saturation and other artifacts.
27
27
  */
28
28
  guidance_scale?: number;
29
+ /**
30
+ * The height in pixels of the output image
31
+ */
32
+ height?: number;
29
33
  /**
30
34
  * One prompt to guide what NOT to include in image generation.
31
35
  */
@@ -44,17 +48,9 @@ export interface TextToImageParameters {
44
48
  */
45
49
  seed?: number;
46
50
  /**
47
- * The size in pixel of the output image
51
+ * The width in pixels of the output image
48
52
  */
49
- target_size?: TargetSize;
50
- [property: string]: unknown;
51
- }
52
- /**
53
- * The size in pixel of the output image
54
- */
55
- export interface TargetSize {
56
- height: number;
57
- width: number;
53
+ width?: number;
58
54
  [property: string]: unknown;
59
55
  }
60
56
  /**
@@ -31,18 +31,13 @@
31
31
  "type": "integer",
32
32
  "description": "The number of denoising steps. More denoising steps usually lead to a higher quality image at the expense of slower inference."
33
33
  },
34
- "target_size": {
35
- "type": "object",
36
- "description": "The size in pixel of the output image",
37
- "properties": {
38
- "width": {
39
- "type": "integer"
40
- },
41
- "height": {
42
- "type": "integer"
43
- }
44
- },
45
- "required": ["width", "height"]
34
+ "width": {
35
+ "type": "integer",
36
+ "description": "The width in pixels of the output image"
37
+ },
38
+ "height": {
39
+ "type": "integer",
40
+ "description": "The height in pixels of the output image"
46
41
  },
47
42
  "scheduler": {
48
43
  "type": "string",