[Misc] Rename translations to speech_to_text for OAI serving component (#33904)
Signed-off-by: NickLucche <nlucches@redhat.com>
This commit is contained in:
@@ -190,11 +190,11 @@ def build_app(args: Namespace, supported_tasks: tuple["SupportedTask", ...]) ->
|
|||||||
register_generate_api_routers(app)
|
register_generate_api_routers(app)
|
||||||
|
|
||||||
if "transcription" in supported_tasks:
|
if "transcription" in supported_tasks:
|
||||||
from vllm.entrypoints.openai.translations.api_router import (
|
from vllm.entrypoints.openai.speech_to_text.api_router import (
|
||||||
attach_router as register_translations_api_router,
|
attach_router as register_speech_to_text_api_router,
|
||||||
)
|
)
|
||||||
|
|
||||||
register_translations_api_router(app)
|
register_speech_to_text_api_router(app)
|
||||||
|
|
||||||
if "realtime" in supported_tasks:
|
if "realtime" in supported_tasks:
|
||||||
from vllm.entrypoints.openai.realtime.api_router import (
|
from vllm.entrypoints.openai.realtime.api_router import (
|
||||||
@@ -318,7 +318,7 @@ async def init_app_state(
|
|||||||
)
|
)
|
||||||
|
|
||||||
if "transcription" in supported_tasks:
|
if "transcription" in supported_tasks:
|
||||||
from vllm.entrypoints.openai.translations.api_router import (
|
from vllm.entrypoints.openai.speech_to_text.api_router import (
|
||||||
init_transcription_state,
|
init_transcription_state,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ from vllm.entrypoints.openai.responses.protocol import (
|
|||||||
from vllm.entrypoints.openai.responses.utils import (
|
from vllm.entrypoints.openai.responses.utils import (
|
||||||
construct_input_messages,
|
construct_input_messages,
|
||||||
)
|
)
|
||||||
from vllm.entrypoints.openai.translations.protocol import (
|
from vllm.entrypoints.openai.speech_to_text.protocol import (
|
||||||
TranscriptionRequest,
|
TranscriptionRequest,
|
||||||
TranscriptionResponse,
|
TranscriptionResponse,
|
||||||
TranslationRequest,
|
TranslationRequest,
|
||||||
|
|||||||
+2
-2
@@ -9,13 +9,13 @@ from fastapi import APIRouter, FastAPI, Form, Request
|
|||||||
from fastapi.responses import JSONResponse, StreamingResponse
|
from fastapi.responses import JSONResponse, StreamingResponse
|
||||||
|
|
||||||
from vllm.entrypoints.openai.engine.protocol import ErrorResponse
|
from vllm.entrypoints.openai.engine.protocol import ErrorResponse
|
||||||
from vllm.entrypoints.openai.translations.protocol import (
|
from vllm.entrypoints.openai.speech_to_text.protocol import (
|
||||||
TranscriptionRequest,
|
TranscriptionRequest,
|
||||||
TranscriptionResponseVariant,
|
TranscriptionResponseVariant,
|
||||||
TranslationRequest,
|
TranslationRequest,
|
||||||
TranslationResponseVariant,
|
TranslationResponseVariant,
|
||||||
)
|
)
|
||||||
from vllm.entrypoints.openai.translations.serving import (
|
from vllm.entrypoints.openai.speech_to_text.serving import (
|
||||||
OpenAIServingTranscription,
|
OpenAIServingTranscription,
|
||||||
OpenAIServingTranslation,
|
OpenAIServingTranslation,
|
||||||
)
|
)
|
||||||
+2
-2
@@ -11,7 +11,7 @@ from vllm.entrypoints.openai.engine.protocol import (
|
|||||||
RequestResponseMetadata,
|
RequestResponseMetadata,
|
||||||
)
|
)
|
||||||
from vllm.entrypoints.openai.models.serving import OpenAIServingModels
|
from vllm.entrypoints.openai.models.serving import OpenAIServingModels
|
||||||
from vllm.entrypoints.openai.translations.protocol import (
|
from vllm.entrypoints.openai.speech_to_text.protocol import (
|
||||||
TranscriptionRequest,
|
TranscriptionRequest,
|
||||||
TranscriptionResponse,
|
TranscriptionResponse,
|
||||||
TranscriptionResponseStreamChoice,
|
TranscriptionResponseStreamChoice,
|
||||||
@@ -23,7 +23,7 @@ from vllm.entrypoints.openai.translations.protocol import (
|
|||||||
TranslationResponseVerbose,
|
TranslationResponseVerbose,
|
||||||
TranslationStreamResponse,
|
TranslationStreamResponse,
|
||||||
)
|
)
|
||||||
from vllm.entrypoints.openai.translations.speech_to_text import OpenAISpeechToText
|
from vllm.entrypoints.openai.speech_to_text.speech_to_text import OpenAISpeechToText
|
||||||
from vllm.logger import init_logger
|
from vllm.logger import init_logger
|
||||||
from vllm.outputs import RequestOutput
|
from vllm.outputs import RequestOutput
|
||||||
|
|
||||||
+2
-2
@@ -24,7 +24,7 @@ from vllm.entrypoints.openai.engine.protocol import (
|
|||||||
)
|
)
|
||||||
from vllm.entrypoints.openai.engine.serving import OpenAIServing, SpeechToTextRequest
|
from vllm.entrypoints.openai.engine.serving import OpenAIServing, SpeechToTextRequest
|
||||||
from vllm.entrypoints.openai.models.serving import OpenAIServingModels
|
from vllm.entrypoints.openai.models.serving import OpenAIServingModels
|
||||||
from vllm.entrypoints.openai.translations.protocol import (
|
from vllm.entrypoints.openai.speech_to_text.protocol import (
|
||||||
TranscriptionResponse,
|
TranscriptionResponse,
|
||||||
TranscriptionResponseStreamChoice,
|
TranscriptionResponseStreamChoice,
|
||||||
TranscriptionResponseVerbose,
|
TranscriptionResponseVerbose,
|
||||||
@@ -402,7 +402,7 @@ class OpenAISpeechToText(OpenAIServing):
|
|||||||
audio_data: bytes,
|
audio_data: bytes,
|
||||||
request: SpeechToTextRequest,
|
request: SpeechToTextRequest,
|
||||||
raw_request: Request,
|
raw_request: Request,
|
||||||
response_class: type[T | V],
|
response_class: type[ResponseType],
|
||||||
stream_generator_method: Callable[..., AsyncGenerator[str, None]],
|
stream_generator_method: Callable[..., AsyncGenerator[str, None]],
|
||||||
) -> T | V | AsyncGenerator[str, None] | ErrorResponse:
|
) -> T | V | AsyncGenerator[str, None] | ErrorResponse:
|
||||||
"""Base method for speech-to-text operations like transcription and
|
"""Base method for speech-to-text operations like transcription and
|
||||||
Reference in New Issue
Block a user