[Frontend] Add diarized_json support for MOSS-Transcribe-Diarize (#48543)
Signed-off-by: Lucas Christian <lucaschgf7@gmail.com>
This commit is contained in:
@@ -18,6 +18,7 @@ from ..base.serving import SpeechToTextBaseServing
|
||||
from .protocol import (
|
||||
TranscriptionRequest,
|
||||
TranscriptionResponse,
|
||||
TranscriptionResponseDiarized,
|
||||
TranscriptionResponseStreamChoice,
|
||||
TranscriptionResponseVerbose,
|
||||
TranscriptionStreamResponse,
|
||||
@@ -55,6 +56,7 @@ class OpenAIServingTranscription(SpeechToTextBaseServing):
|
||||
) -> (
|
||||
TranscriptionResponse
|
||||
| TranscriptionResponseVerbose
|
||||
| TranscriptionResponseDiarized
|
||||
| AsyncGenerator[str, None]
|
||||
| ErrorResponse
|
||||
):
|
||||
@@ -70,6 +72,8 @@ class OpenAIServingTranscription(SpeechToTextBaseServing):
|
||||
response_class=(
|
||||
TranscriptionResponseVerbose
|
||||
if request.response_format == "verbose_json"
|
||||
else TranscriptionResponseDiarized
|
||||
if request.response_format == "diarized_json"
|
||||
else TranscriptionResponse
|
||||
),
|
||||
stream_generator_method=self.transcription_stream_generator,
|
||||
|
||||
Reference in New Issue
Block a user