Add pydocstyle to the ruff rules (#52136)
Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com> Signed-off-by: Harry Mellor <hej.mellor@gmail.com> Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
804e5377aa
commit
8c1557a79c
@@ -92,7 +92,8 @@ def asr_inter_chunk_separator(
|
||||
|
||||
class SpeechToTextBaseServing(GenerateBaseServing):
|
||||
"""Base class for speech-to-text operations like transcription and
|
||||
translation."""
|
||||
translation.
|
||||
"""
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
@@ -358,8 +359,7 @@ class SpeechToTextBaseServing(GenerateBaseServing):
|
||||
segment_class: type[SpeechToTextSegment],
|
||||
start_time: float = 0,
|
||||
) -> list[SpeechToTextSegment]:
|
||||
"""
|
||||
Convert tokens to verbose segments.
|
||||
"""Convert tokens to verbose segments.
|
||||
|
||||
This method expects the model to produce
|
||||
timestamps as tokens (similar to Whisper).
|
||||
@@ -427,7 +427,8 @@ class SpeechToTextBaseServing(GenerateBaseServing):
|
||||
stream_generator_method: Callable[..., AsyncGenerator[str, None]],
|
||||
) -> T | V | AsyncGenerator[str, None] | ErrorResponse:
|
||||
"""Base method for speech-to-text operations like transcription and
|
||||
translation."""
|
||||
translation.
|
||||
"""
|
||||
if request.stream and request.use_beam_search:
|
||||
return self.create_error_response(
|
||||
"Streaming is not currently supported with beam search"
|
||||
|
||||
@@ -33,6 +33,7 @@ async def read_upload_with_limit(
|
||||
|
||||
Raises:
|
||||
VLLMValidationError: If the file exceeds the configured size limit.
|
||||
|
||||
"""
|
||||
if max_size_mb is None:
|
||||
max_size_mb = envs.VLLM_MAX_AUDIO_CLIP_FILESIZE_MB
|
||||
|
||||
@@ -13,14 +13,14 @@ from vllm.utils import random_uuid
|
||||
|
||||
|
||||
class InputAudioBufferAppend(OpenAIBaseModel):
|
||||
"""Append audio chunk to buffer"""
|
||||
"""Append audio chunk to buffer."""
|
||||
|
||||
type: Literal["input_audio_buffer.append"] = "input_audio_buffer.append"
|
||||
audio: str # base64-encoded PCM16 @ 16kHz
|
||||
|
||||
|
||||
class InputAudioBufferCommit(OpenAIBaseModel):
|
||||
"""Process accumulated audio buffer"""
|
||||
"""Process accumulated audio buffer."""
|
||||
|
||||
type: Literal["input_audio_buffer.commit"] = "input_audio_buffer.commit"
|
||||
final: bool = False
|
||||
@@ -28,14 +28,14 @@ class InputAudioBufferCommit(OpenAIBaseModel):
|
||||
|
||||
# Server -> Client Events
|
||||
class SessionUpdate(OpenAIBaseModel):
|
||||
"""Configure session parameters"""
|
||||
"""Configure session parameters."""
|
||||
|
||||
type: Literal["session.update"] = "session.update"
|
||||
model: str | None = None
|
||||
|
||||
|
||||
class SessionCreated(OpenAIBaseModel):
|
||||
"""Connection established notification"""
|
||||
"""Connection established notification."""
|
||||
|
||||
type: Literal["session.created"] = "session.created"
|
||||
id: str = Field(default_factory=lambda: f"sess-{random_uuid()}")
|
||||
@@ -43,14 +43,14 @@ class SessionCreated(OpenAIBaseModel):
|
||||
|
||||
|
||||
class TranscriptionDelta(OpenAIBaseModel):
|
||||
"""Incremental transcription text"""
|
||||
"""Incremental transcription text."""
|
||||
|
||||
type: Literal["transcription.delta"] = "transcription.delta"
|
||||
delta: str # Incremental text
|
||||
|
||||
|
||||
class TranscriptionDone(OpenAIBaseModel):
|
||||
"""Final transcription with usage stats"""
|
||||
"""Final transcription with usage stats."""
|
||||
|
||||
type: Literal["transcription.done"] = "transcription.done"
|
||||
text: str # Complete transcription
|
||||
@@ -58,7 +58,7 @@ class TranscriptionDone(OpenAIBaseModel):
|
||||
|
||||
|
||||
class ErrorEvent(OpenAIBaseModel):
|
||||
"""Error notification"""
|
||||
"""Error notification."""
|
||||
|
||||
type: Literal["error"] = "error"
|
||||
error: str
|
||||
|
||||
@@ -68,6 +68,7 @@ class OpenAIServingRealtime(GenerateBaseServing):
|
||||
|
||||
Yields:
|
||||
StreamingInput objects containing audio prompts for the engine
|
||||
|
||||
"""
|
||||
model_config = self.model_config
|
||||
renderer = self.renderer
|
||||
|
||||
Reference in New Issue
Block a user