Skip to content

Commit c843fbe

Browse files
[Tasks] update automatic speech recognition output specs (huggingface#1167)
It should have been `timestamp` instead of `timestamps` (see transformers pipeline output [here](https://github.com/huggingface/transformers/blob/9d2056f12b66e64978f78a2dcb023f65b2be2108/src/transformers/pipelines/automatic_speech_recognition.py#L648)). this also aligns with fal-ai output [specs](https://fal.ai/models/fal-ai/whisper/api#type-WhisperChunk) of the model which is currently supported.
1 parent 34e5352 commit c843fbe

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

packages/tasks/src/tasks/automatic-speech-recognition/inference.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,6 @@ export interface AutomaticSpeechRecognitionOutputChunk {
145145
/**
146146
* The start and end timestamps corresponding with the text
147147
*/
148-
timestamps: number[];
148+
timestamp: number[];
149149
[property: string]: unknown;
150150
}

packages/tasks/src/tasks/automatic-speech-recognition/spec/output.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"type": "string",
2121
"description": "A chunk of text identified by the model"
2222
},
23-
"timestamps": {
23+
"timestamp": {
2424
"type": "array",
2525
"description": "The start and end timestamps corresponding with the text",
2626
"items": {
@@ -30,7 +30,7 @@
3030
"maxLength": 2
3131
}
3232
},
33-
"required": ["text", "timestamps"]
33+
"required": ["text", "timestamp"]
3434
}
3535
}
3636
},

0 commit comments

Comments
 (0)