From acdd6ca955e766b182565716b63e7a0021afbe9c Mon Sep 17 00:00:00 2001 From: Wauplin <11801849+Wauplin@users.noreply.github.com> Date: Sat, 15 Nov 2025 03:25:25 +0000 Subject: [PATCH] Update tasks specs (automated commit) --- .../tasks/src/tasks/feature-extraction/inference.ts | 7 ++++++- .../tasks/src/tasks/feature-extraction/spec/input.json | 10 +++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/packages/tasks/src/tasks/feature-extraction/inference.ts b/packages/tasks/src/tasks/feature-extraction/inference.ts index f60bef6113..9049a45c46 100644 --- a/packages/tasks/src/tasks/feature-extraction/inference.ts +++ b/packages/tasks/src/tasks/feature-extraction/inference.ts @@ -12,6 +12,11 @@ export type FeatureExtractionOutput = Array; * https://github.com/huggingface/huggingface.js/blob/main/packages/tasks/scripts/inference-tei-import.ts. */ export interface FeatureExtractionInput { + /** + * The number of dimensions that the output embeddings should have. If not set, the original + * shape of the representation will be returned instead. + */ + dimensions?: number; /** * The text or list of texts to embed. */ @@ -38,4 +43,4 @@ export interface FeatureExtractionInput { * The text or list of texts to embed. */ export type FeatureExtractionInputs = string[] | string; -export type FeatureExtractionInputTruncationDirection = "left" | "right"; +export type FeatureExtractionInputTruncationDirection = "Left" | "Right"; diff --git a/packages/tasks/src/tasks/feature-extraction/spec/input.json b/packages/tasks/src/tasks/feature-extraction/spec/input.json index 1b386746f7..5cd311946b 100644 --- a/packages/tasks/src/tasks/feature-extraction/spec/input.json +++ b/packages/tasks/src/tasks/feature-extraction/spec/input.json @@ -6,6 +6,14 @@ "type": "object", "required": ["inputs"], "properties": { + "dimensions": { + "type": "integer", + "description": "The number of dimensions that the output embeddings should have. If not set, the original\nshape of the representation will be returned instead.", + "default": "null", + "example": "null", + "nullable": true, + "minimum": 0 + }, "inputs": { "title": "FeatureExtractionInputs", "description": "The text or list of texts to embed.", @@ -51,7 +59,7 @@ "$defs": { "FeatureExtractionInputTruncationDirection": { "type": "string", - "enum": ["left", "right"], + "enum": ["Left", "Right"], "title": "FeatureExtractionInputTruncationDirection" } }