vllm.entrypoints.speech_to_text.translation.protocol
¶
Classes:
-
TranslationRequest– -
TranslationResponse– -
TranslationResponseVerbose– -
TranslationSegment– -
TranslationWord–
TranslationRequest
¶
Bases: OpenAIBaseModel
Attributes:
-
file(UploadFile) –The audio file object (not file name) to translate, in one of these
-
frequency_penalty(float | None) –The frequency penalty to use for sampling.
-
hotwords(str | None) –hotwords refers to a list of important words or phrases that the model
-
include_stop_str_in_output(bool) –Whether to include the stop strings in output text.
-
language(str | None) –The language of the input audio we translate from.
-
length_penalty(float) –Length penalty to be used for beam search.
-
max_completion_tokens(int | None) –The maximum number of tokens to generate.
-
min_p(float | None) –Filters out tokens with a probability lower than
min_p, ensuring a -
model(str | None) –ID of the model to use.
-
n(int) –The number of beams to be used in beam search.
-
presence_penalty(float | None) –The presence penalty to use for sampling.
-
prompt(str) –An optional text to guide the model's style or continue a previous audio
-
repetition_penalty(float | None) –The repetition penalty to use for sampling.
-
response_format(AudioResponseFormat) –The format of the output, in one of these options:
json,text,srt, -
seed(int | None) –The seed to use for sampling.
-
stream(bool | None) –Custom field not present in the original OpenAI definition. When set,
-
temperature(float) –The sampling temperature, between 0 and 1.
-
to_language(str | None) –The language of the input audio we translate to.
-
top_k(int | None) –Limits sampling to the
kmost probable tokens at each step. -
top_p(float | None) –Enables nucleus (top-p) sampling, where tokens are selected from the
-
use_beam_search(bool) –Whether or not beam search should be used.
-
watermarking(bool | None) –Whether to apply the engine's configured watermark to this request.
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.
frequency_penalty = 0.0
class-attribute
instance-attribute
¶
The frequency penalty to use for sampling.
hotwords = None
class-attribute
instance-attribute
¶
hotwords refers to a list of important words or phrases that the model should pay extra attention to during transcription.
include_stop_str_in_output = False
class-attribute
instance-attribute
¶
Whether to include the stop strings in output text.
language = None
class-attribute
instance-attribute
¶
The language of the input audio we translate from.
Supplying the input language in ISO-639-1 format will improve accuracy.
length_penalty = 1.0
class-attribute
instance-attribute
¶
Length penalty to be used for beam search.
max_completion_tokens = None
class-attribute
instance-attribute
¶
The maximum number of tokens to generate.
min_p = None
class-attribute
instance-attribute
¶
Filters out tokens with a probability lower than min_p, ensuring a
minimum likelihood threshold during sampling.
model = None
class-attribute
instance-attribute
¶
ID of the model to use.
n = 1
class-attribute
instance-attribute
¶
The number of beams to be used in beam search.
presence_penalty = 0.0
class-attribute
instance-attribute
¶
The presence penalty to use for sampling.
prompt = Field(default='')
class-attribute
instance-attribute
¶
An optional text to guide the model's style or continue a previous audio segment.
The prompt should match the audio language.
repetition_penalty = None
class-attribute
instance-attribute
¶
The repetition penalty to use for sampling.
response_format = Field(default='json')
class-attribute
instance-attribute
¶
The format of the output, in one of these options: json, text, srt,
verbose_json, or vtt.
seed = Field(None, ge=_LONG_INFO.min, le=_LONG_INFO.max)
class-attribute
instance-attribute
¶
The seed to use for sampling.
stream = False
class-attribute
instance-attribute
¶
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.
temperature = Field(default=0.0)
class-attribute
instance-attribute
¶
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 = None
class-attribute
instance-attribute
¶
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.
top_k = None
class-attribute
instance-attribute
¶
Limits sampling to the k most probable tokens at each step.
top_p = None
class-attribute
instance-attribute
¶
Enables nucleus (top-p) sampling, where tokens are selected from the
smallest possible set whose cumulative probability exceeds p.
use_beam_search = False
class-attribute
instance-attribute
¶
Whether or not beam search should be used.
watermarking = None
class-attribute
instance-attribute
¶
Whether to apply the engine's configured watermark to this request.
TranslationResponse
¶
TranslationResponseVerbose
¶
Bases: OpenAIBaseModel
Attributes:
-
duration(float) –The duration of the input audio.
-
language(str) –The language of the input audio.
-
segments(list[TranslationSegment] | None) –Segments of the translated text and their corresponding details.
-
text(str) –The translated text.
-
words(list[TranslationWord] | None) –Extracted words and their corresponding timestamps.
duration
instance-attribute
¶
The duration of the input audio.
language
instance-attribute
¶
The language of the input audio.
segments = None
class-attribute
instance-attribute
¶
Segments of the translated text and their corresponding details.
text
instance-attribute
¶
The translated text.
words = None
class-attribute
instance-attribute
¶
Extracted words and their corresponding timestamps.
TranslationSegment
¶
Bases: OpenAIBaseModel
Attributes:
-
avg_logprob(float) –Average logprob of the segment.
-
compression_ratio(float) –Compression ratio of the segment.
-
end(float) –End time of the segment in seconds.
-
id(int) –Unique identifier of the segment.
-
no_speech_prob(float | None) –Probability of no speech in the segment.
-
seek(int) –Seek offset of the segment.
-
start(float) –Start time of the segment in seconds.
-
temperature(float) –Temperature parameter used for generating the segment.
-
text(str) –Text content of the segment.
-
tokens(list[int]) –Array of token IDs for the text content.
avg_logprob
instance-attribute
¶
Average logprob of the segment.
If the value is lower than -1, consider the logprobs failed.
compression_ratio
instance-attribute
¶
Compression ratio of the segment.
If the value is greater than 2.4, consider the compression failed.
end
instance-attribute
¶
End time of the segment in seconds.
id
instance-attribute
¶
Unique identifier of the segment.
no_speech_prob = None
class-attribute
instance-attribute
¶
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.
seek
instance-attribute
¶
Seek offset of the segment.
start
instance-attribute
¶
Start time of the segment in seconds.
temperature
instance-attribute
¶
Temperature parameter used for generating the segment.
text
instance-attribute
¶
Text content of the segment.
tokens
instance-attribute
¶
Array of token IDs for the text content.
TranslationWord
¶
Bases: OpenAIBaseModel
Attributes: