Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions packages/tasks/src/tasks/feature-extraction/inference.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ export type FeatureExtractionOutput = Array<number[]>;
* 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.
*/
Expand Down
8 changes: 8 additions & 0 deletions packages/tasks/src/tasks/feature-extraction/spec/input.json
Original file line number Diff line number Diff line change
Expand Up @@ -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.",
Expand Down