vllm.entrypoints.openai.translations.protocol ¶
AudioResponseFormat module-attribute ¶
TranscriptionResponseVariant module-attribute ¶
TranscriptionResponseVariant: TypeAlias = (
TranscriptionResponse | TranscriptionResponseVerbose
)
TranslationResponseVariant module-attribute ¶
TranslationResponseVariant: TypeAlias = (
TranslationResponse | TranslationResponseVerbose
)
TranscriptionRequest ¶
Bases: OpenAIBaseModel
Source code in vllm/entrypoints/openai/translations/protocol.py
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 | |
_DEFAULT_SAMPLING_PARAMS class-attribute instance-attribute ¶
_DEFAULT_SAMPLING_PARAMS: dict = {
"repetition_penalty": 1.0,
"temperature": 1.0,
"top_p": 1.0,
"top_k": 0,
"min_p": 0.0,
}
file instance-attribute ¶
The audio file object (not file name) to transcribe, in one of these formats: flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, or webm.
frequency_penalty class-attribute instance-attribute ¶
frequency_penalty: float | None = 0.0
The frequency penalty to use for sampling.
language class-attribute instance-attribute ¶
language: str | None = None
The language of the input audio.
Supplying the input language in ISO-639-1 format will improve accuracy and latency.
max_completion_tokens class-attribute instance-attribute ¶
max_completion_tokens: int | None = None
The maximum number of tokens to generate.
min_p class-attribute instance-attribute ¶
min_p: float | None = None
Filters out tokens with a probability lower than min_p, ensuring a minimum likelihood threshold during sampling.
presence_penalty class-attribute instance-attribute ¶
presence_penalty: float | None = 0.0
The presence penalty to use for sampling.
prompt class-attribute instance-attribute ¶
prompt: str = Field(default='')
An optional text to guide the model's style or continue a previous audio segment.
The prompt should match the audio language.
repetition_penalty class-attribute instance-attribute ¶
repetition_penalty: float | None = None
The repetition penalty to use for sampling.
response_format class-attribute instance-attribute ¶
response_format: AudioResponseFormat = Field(default="json")
The format of the output, in one of these options: json, text, srt, verbose_json, or vtt.
seed class-attribute instance-attribute ¶
seed: int | None = Field(None, ge=min, le=max)
The seed to use for sampling.
stream class-attribute instance-attribute ¶
stream: bool | None = False
When set, it will enable output to be streamed in a similar fashion as the Chat Completion endpoint.
stream_continuous_usage_stats class-attribute instance-attribute ¶
stream_continuous_usage_stats: bool | None = False
temperature class-attribute instance-attribute ¶
temperature: float = Field(default=0.0)
The sampling temperature, between 0 and 1.
Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused / deterministic. If set to 0, the model will use log probability to automatically increase the temperature until certain thresholds are hit.
timestamp_granularities class-attribute instance-attribute ¶
timestamp_granularities: list[
Literal["word", "segment"]
] = Field(alias="timestamp_granularities[]", default=[])
The timestamp granularities to populate for this transcription.
response_format must be set verbose_json to use timestamp granularities. Either or both of these options are supported: word, or segment. Note: There is no additional latency for segment timestamps, but generating word timestamps incurs additional latency.
to_language class-attribute instance-attribute ¶
to_language: str | None = None
The language of the output audio we transcribe to.
Please note that this is not currently used by supported models at this time, but it is a placeholder for future use, matching translation api.
top_k class-attribute instance-attribute ¶
top_k: int | None = None
Limits sampling to the k most probable tokens at each step.
top_p class-attribute instance-attribute ¶
top_p: float | None = None
Enables nucleus (top-p) sampling, where tokens are selected from the smallest possible set whose cumulative probability exceeds p.
vllm_xargs class-attribute instance-attribute ¶
vllm_xargs: dict[str, str | int | float] | None = Field(
default=None,
description="Additional request parameters with string or numeric values, used by custom extensions.",
)
to_sampling_params ¶
to_sampling_params(
default_max_tokens: int,
default_sampling_params: dict | None = None,
) -> SamplingParams
Source code in vllm/entrypoints/openai/translations/protocol.py
validate_transcription_request classmethod ¶
Source code in vllm/entrypoints/openai/translations/protocol.py
TranscriptionResponse ¶
TranscriptionResponseStreamChoice ¶
Bases: OpenAIBaseModel
Source code in vllm/entrypoints/openai/translations/protocol.py
TranscriptionResponseVerbose ¶
Bases: OpenAIBaseModel
Source code in vllm/entrypoints/openai/translations/protocol.py
segments class-attribute instance-attribute ¶
segments: list[TranscriptionSegment] | None = None
Segments of the transcribed text and their corresponding details.
words class-attribute instance-attribute ¶
words: list[TranscriptionWord] | None = None
Extracted words and their corresponding timestamps.
TranscriptionSegment ¶
Bases: OpenAIBaseModel
Source code in vllm/entrypoints/openai/translations/protocol.py
avg_logprob instance-attribute ¶
avg_logprob: float
Average logprob of the segment.
If the value is lower than -1, consider the logprobs failed.
compression_ratio instance-attribute ¶
compression_ratio: float
Compression ratio of the segment.
If the value is greater than 2.4, consider the compression failed.
no_speech_prob class-attribute instance-attribute ¶
no_speech_prob: float | None = None
Probability of no speech in the segment.
If the value is higher than 1.0 and the avg_logprob is below -1, consider this segment silent.
TranscriptionStreamResponse ¶
Bases: OpenAIBaseModel
Source code in vllm/entrypoints/openai/translations/protocol.py
TranscriptionUsageAudio ¶
Bases: OpenAIBaseModel
Source code in vllm/entrypoints/openai/translations/protocol.py
TranscriptionWord ¶
Bases: OpenAIBaseModel
Source code in vllm/entrypoints/openai/translations/protocol.py
TranslationRequest ¶
Bases: OpenAIBaseModel
Source code in vllm/entrypoints/openai/translations/protocol.py
349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 | |
_DEFAULT_SAMPLING_PARAMS class-attribute instance-attribute ¶
_DEFAULT_SAMPLING_PARAMS: dict = {'temperature': 0}
file instance-attribute ¶
The audio file object (not file name) to translate, in one of these formats: flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, or webm.
language class-attribute instance-attribute ¶
language: str | None = None
The language of the input audio we translate from.
Supplying the input language in ISO-639-1 format will improve accuracy.
max_completion_tokens class-attribute instance-attribute ¶
max_completion_tokens: int | None = None
The maximum number of tokens to generate.
prompt class-attribute instance-attribute ¶
prompt: str = Field(default='')
An optional text to guide the model's style or continue a previous audio segment.
The prompt should match the audio language.
response_format class-attribute instance-attribute ¶
response_format: AudioResponseFormat = Field(default="json")
The format of the output, in one of these options: json, text, srt, verbose_json, or vtt.
seed class-attribute instance-attribute ¶
seed: int | None = Field(None, ge=min, le=max)
The seed to use for sampling.
stream class-attribute instance-attribute ¶
stream: bool | None = False
Custom field not present in the original OpenAI definition. When set, it will enable output to be streamed in a similar fashion as the Chat Completion endpoint.
stream_continuous_usage_stats class-attribute instance-attribute ¶
stream_continuous_usage_stats: bool | None = False
temperature class-attribute instance-attribute ¶
temperature: float = Field(default=0.0)
The sampling temperature, between 0 and 1.
Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused / deterministic. If set to 0, the model will use log probability to automatically increase the temperature until certain thresholds are hit.
to_language class-attribute instance-attribute ¶
to_language: str | None = None
The language of the input audio we translate to.
Please note that this is not supported by all models, refer to the specific model documentation for more details. For instance, Whisper only supports to_language=en.
to_sampling_params ¶
to_sampling_params(
default_max_tokens: int,
default_sampling_params: dict | None = None,
) -> SamplingParams
Source code in vllm/entrypoints/openai/translations/protocol.py
validate_stream_options classmethod ¶
Source code in vllm/entrypoints/openai/translations/protocol.py
TranslationResponse ¶
TranslationResponseStreamChoice ¶
Bases: OpenAIBaseModel
Source code in vllm/entrypoints/openai/translations/protocol.py
TranslationResponseVerbose ¶
Bases: OpenAIBaseModel
Source code in vllm/entrypoints/openai/translations/protocol.py
segments class-attribute instance-attribute ¶
segments: list[TranslationSegment] | None = None
Segments of the translated text and their corresponding details.
words class-attribute instance-attribute ¶
words: list[TranslationWord] | None = None
Extracted words and their corresponding timestamps.
TranslationSegment ¶
Bases: OpenAIBaseModel
Source code in vllm/entrypoints/openai/translations/protocol.py
avg_logprob instance-attribute ¶
avg_logprob: float
Average logprob of the segment.
If the value is lower than -1, consider the logprobs failed.
compression_ratio instance-attribute ¶
compression_ratio: float
Compression ratio of the segment.
If the value is greater than 2.4, consider the compression failed.
no_speech_prob class-attribute instance-attribute ¶
no_speech_prob: float | None = None
Probability of no speech in the segment.
If the value is higher than 1.0 and the avg_logprob is below -1, consider this segment silent.
TranslationStreamResponse ¶
Bases: OpenAIBaseModel
Source code in vllm/entrypoints/openai/translations/protocol.py
TranslationWord ¶
Bases: OpenAIBaseModel