Skip to content

Commit 1bbf68a

Browse files
authored
♻️ [ Tasks] Rename data -> inputs to conform existing APIs (#471)
Part of #463 Rename `data` to `inputs` to conform existing APIs format
1 parent 76b9792 commit 1bbf68a

File tree

54 files changed

+92
-83
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+92
-83
lines changed

Diff for: packages/tasks/src/tasks/audio-classification/inference.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export interface AudioClassificationInput {
1010
/**
1111
* The input audio data
1212
*/
13-
data: unknown;
13+
inputs: unknown;
1414
/**
1515
* Additional inference parameters
1616
*/

Diff for: packages/tasks/src/tasks/audio-classification/spec/input.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"title": "AudioClassificationInput",
66
"type": "object",
77
"properties": {
8-
"data": {
8+
"inputs": {
99
"description": "The input audio data"
1010
},
1111
"parameters": {
@@ -30,5 +30,5 @@
3030
}
3131
}
3232
},
33-
"required": ["data"]
33+
"required": ["inputs"]
3434
}

Diff for: packages/tasks/src/tasks/automatic-speech-recognition/inference.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export interface AutomaticSpeechRecognitionInput {
1010
/**
1111
* The input audio data
1212
*/
13-
data: unknown;
13+
inputs: unknown;
1414
/**
1515
* Additional inference parameters
1616
*/

Diff for: packages/tasks/src/tasks/automatic-speech-recognition/spec/input.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"title": "AutomaticSpeechRecognitionInput",
66
"type": "object",
77
"properties": {
8-
"data": {
8+
"inputs": {
99
"description": "The input audio data"
1010
},
1111
"parameters": {
@@ -30,5 +30,5 @@
3030
}
3131
}
3232
},
33-
"required": ["data"]
33+
"required": ["inputs"]
3434
}

Diff for: packages/tasks/src/tasks/depth-estimation/inference.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export interface DepthEstimationInput {
1111
/**
1212
* The input image data
1313
*/
14-
data: unknown;
14+
inputs: unknown;
1515
/**
1616
* Additional inference parameters
1717
*/

Diff for: packages/tasks/src/tasks/depth-estimation/spec/input.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"title": "DepthEstimationInput",
66
"type": "object",
77
"properties": {
8-
"data": {
8+
"inputs": {
99
"description": "The input image data"
1010
},
1111
"parameters": {
@@ -21,5 +21,5 @@
2121
"properties": {}
2222
}
2323
},
24-
"required": ["data"]
24+
"required": ["inputs"]
2525
}

Diff for: packages/tasks/src/tasks/document-question-answering/inference.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export interface DocumentQuestionAnsweringInput {
1010
/**
1111
* One (document, question) pair to answer
1212
*/
13-
data: DocumentQuestionAnsweringInputData;
13+
inputs: DocumentQuestionAnsweringInputData;
1414
/**
1515
* Additional inference parameters
1616
*/

Diff for: packages/tasks/src/tasks/document-question-answering/spec/input.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"title": "DocumentQuestionAnsweringInput",
66
"type": "object",
77
"properties": {
8-
"data": {
8+
"inputs": {
99
"description": "One (document, question) pair to answer",
1010
"type": "object",
1111
"title": "DocumentQuestionAnsweringInputData",
@@ -81,5 +81,5 @@
8181
}
8282
}
8383
},
84-
"required": ["data"]
84+
"required": ["inputs"]
8585
}

Diff for: packages/tasks/src/tasks/feature-extraction/inference.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export interface FeatureExtractionInput {
1313
/**
1414
* The text to get the embeddings of
1515
*/
16-
data: string;
16+
inputs: string;
1717
/**
1818
* Additional inference parameters
1919
*/

Diff for: packages/tasks/src/tasks/feature-extraction/spec/input.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"title": "FeatureExtractionInput",
66
"type": "object",
77
"properties": {
8-
"data": {
8+
"inputs": {
99
"description": "The text to get the embeddings of",
1010
"type": "string"
1111
},
@@ -22,5 +22,5 @@
2222
"properties": {}
2323
}
2424
},
25-
"required": ["data"]
25+
"required": ["inputs"]
2626
}

Diff for: packages/tasks/src/tasks/fill-mask/inference.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export interface FillMaskInput {
1010
/**
1111
* The text with masked tokens
1212
*/
13-
data: string;
13+
inputs: string;
1414
/**
1515
* Additional inference parameters
1616
*/

Diff for: packages/tasks/src/tasks/fill-mask/spec/input.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"title": "FillMaskInput",
66
"type": "object",
77
"properties": {
8-
"data": {
8+
"inputs": {
99
"description": "The text with masked tokens",
1010
"type": "string"
1111
},
@@ -34,5 +34,5 @@
3434
}
3535
}
3636
},
37-
"required": ["data"]
37+
"required": ["inputs"]
3838
}

Diff for: packages/tasks/src/tasks/image-classification/inference.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export interface ImageClassificationInput {
1010
/**
1111
* The input image data
1212
*/
13-
data: unknown;
13+
inputs: unknown;
1414
/**
1515
* Additional inference parameters
1616
*/

Diff for: packages/tasks/src/tasks/image-classification/spec/input.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"title": "ImageClassificationInput",
66
"type": "object",
77
"properties": {
8-
"data": {
8+
"inputs": {
99
"description": "The input image data"
1010
},
1111
"parameters": {
@@ -30,5 +30,5 @@
3030
}
3131
}
3232
},
33-
"required": ["data"]
33+
"required": ["inputs"]
3434
}

Diff for: packages/tasks/src/tasks/image-segmentation/inference.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export interface ImageSegmentationInput {
1010
/**
1111
* The input image data
1212
*/
13-
data: unknown;
13+
inputs: unknown;
1414
/**
1515
* Additional inference parameters
1616
*/

Diff for: packages/tasks/src/tasks/image-segmentation/spec/input.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"title": "ImageSegmentationInput",
66
"type": "object",
77
"properties": {
8-
"data": {
8+
"inputs": {
99
"description": "The input image data"
1010
},
1111
"parameters": {
@@ -50,5 +50,5 @@
5050
}
5151
}
5252
},
53-
"required": ["data"]
53+
"required": ["inputs"]
5454
}

Diff for: packages/tasks/src/tasks/image-to-image/inference.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export interface ImageToImageInput {
1111
/**
1212
* The input image data
1313
*/
14-
data: unknown;
14+
inputs: unknown;
1515
/**
1616
* Additional inference parameters
1717
*/

Diff for: packages/tasks/src/tasks/image-to-image/spec/input.json

+5-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"title": "ImageToImageInput",
66
"type": "object",
77
"properties": {
8-
"data": {
8+
"inputs": {
99
"description": "The input image data"
1010
},
1111
"parameters": {
@@ -25,7 +25,9 @@
2525
},
2626
"negativePrompt": {
2727
"type": "array",
28-
"items": { "type": "string" },
28+
"items": {
29+
"type": "string"
30+
},
2931
"description": "One or several prompt to guide what NOT to include in image generation."
3032
},
3133
"numInferenceSteps": {
@@ -48,5 +50,5 @@
4850
}
4951
}
5052
},
51-
"required": ["data"]
53+
"required": ["inputs"]
5254
}

Diff for: packages/tasks/src/tasks/image-to-text/inference.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export interface ImageToTextInput {
1010
/**
1111
* The input image data
1212
*/
13-
data: unknown;
13+
inputs: unknown;
1414
/**
1515
* Additional inference parameters
1616
*/

Diff for: packages/tasks/src/tasks/image-to-text/spec/input.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"title": "ImageToTextInput",
66
"type": "object",
77
"properties": {
8-
"data": {
8+
"inputs": {
99
"description": "The input image data"
1010
},
1111
"parameters": {
@@ -30,5 +30,5 @@
3030
}
3131
}
3232
},
33-
"required": ["data"]
33+
"required": ["inputs"]
3434
}

Diff for: packages/tasks/src/tasks/object-detection/inference.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export interface ObjectDetectionInput {
1010
/**
1111
* The input image data
1212
*/
13-
data: unknown;
13+
inputs: unknown;
1414
/**
1515
* Additional inference parameters
1616
*/

Diff for: packages/tasks/src/tasks/object-detection/spec/input.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"title": "ObjectDetectionInput",
66
"type": "object",
77
"properties": {
8-
"data": {
8+
"inputs": {
99
"description": "The input image data"
1010
},
1111
"parameters": {
@@ -26,5 +26,5 @@
2626
}
2727
}
2828
},
29-
"required": ["data"]
29+
"required": ["inputs"]
3030
}

Diff for: packages/tasks/src/tasks/placeholder/spec/input.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"title": "PlaceholderInput",
66
"type": "object",
77
"properties": {
8-
"data": {
8+
"inputs": {
99
"description": "TODO: describe the input here. This must be model & framework agnostic.",
1010
"type": "string"
1111
},
@@ -31,5 +31,5 @@
3131
}
3232
}
3333
},
34-
"required": ["data"]
34+
"required": ["inputs"]
3535
}

Diff for: packages/tasks/src/tasks/question-answering/inference.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export interface QuestionAnsweringInput {
1010
/**
1111
* One (context, question) pair to answer
1212
*/
13-
data: QuestionAnsweringInputData;
13+
inputs: QuestionAnsweringInputData;
1414
/**
1515
* Additional inference parameters
1616
*/

Diff for: packages/tasks/src/tasks/question-answering/spec/input.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"title": "QuestionAnsweringInput",
66
"type": "object",
77
"properties": {
8-
"data": {
8+
"inputs": {
99
"title": "QuestionAnsweringInputData",
1010
"description": "One (context, question) pair to answer",
1111
"type": "object",
@@ -63,5 +63,5 @@
6363
}
6464
}
6565
},
66-
"required": ["data"]
66+
"required": ["inputs"]
6767
}

Diff for: packages/tasks/src/tasks/sentence-similarity/inference.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export type SentenceSimilarityOutput = number[];
1010
* Inputs for Sentence similarity inference
1111
*/
1212
export interface SentenceSimilarityInput {
13-
data: SentenceSimilarityInputData;
13+
inputs: SentenceSimilarityInputData;
1414
/**
1515
* Additional inference parameters
1616
*/

Diff for: packages/tasks/src/tasks/sentence-similarity/spec/input.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"title": "SentenceSimilarityInput",
66
"type": "object",
77
"properties": {
8-
"data": {
8+
"inputs": {
99
"title": "SentenceSimilarityInputData",
1010
"type": "object",
1111
"properties": {
@@ -36,5 +36,5 @@
3636
"properties": {}
3737
}
3838
},
39-
"required": ["data"]
39+
"required": ["inputs"]
4040
}

Diff for: packages/tasks/src/tasks/summarization/inference.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export interface SummarizationInput {
1313
/**
1414
* The input text data
1515
*/
16-
data: string;
16+
inputs: string;
1717
/**
1818
* Additional inference parameters
1919
*/

Diff for: packages/tasks/src/tasks/table-question-answering/inference.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export interface TableQuestionAnsweringInput {
1010
/**
1111
* One (table, question) pair to answer
1212
*/
13-
data: TableQuestionAnsweringInputData;
13+
inputs: TableQuestionAnsweringInputData;
1414
/**
1515
* Additional inference parameters
1616
*/

Diff for: packages/tasks/src/tasks/table-question-answering/spec/input.json

+8-3
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,20 @@
55
"title": "TableQuestionAnsweringInput",
66
"type": "object",
77
"properties": {
8-
"data": {
8+
"inputs": {
99
"description": "One (table, question) pair to answer",
1010
"title": "TableQuestionAnsweringInputData",
1111
"type": "object",
1212
"properties": {
1313
"table": {
1414
"description": "The table to serve as context for the questions",
1515
"type": "object",
16-
"additionalProperties": { "type": "array", "items": { "type": "string" } }
16+
"additionalProperties": {
17+
"type": "array",
18+
"items": {
19+
"type": "string"
20+
}
21+
}
1722
},
1823
"question": {
1924
"description": "The question to be answered about the table",
@@ -35,5 +40,5 @@
3540
"properties": {}
3641
}
3742
},
38-
"required": ["data"]
43+
"required": ["inputs"]
3944
}

0 commit comments

Comments
 (0)