vllm.transformers_utils.processors.kimi_audio ¶
Processor for Kimi-Audio ASR model.
KimiAudioProcessor ¶
Bases: ProcessorMixin
Constructs a Kimi-Audio processor.
[KimiAudioProcessor] offers all the functionalities of [WhisperFeatureExtractor], and a tokenizer. See the [~KimiAudioProcessor.__call__] and [~KimiAudioProcessor.decode] for more information.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
feature_extractor | [`WhisperFeatureExtractor`], *optional* | The audio feature extractor. | None |
tokenizer | [`PreTrainedTokenizer`], *optional* | The text tokenizer. | None |
Source code in vllm/transformers_utils/processors/kimi_audio.py
44 45 46 47 48 49 50 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 | |
__call__ ¶
__call__(
text: TextInput = None,
audio: AudioInput = None,
return_tensors: str = "pt",
**kwargs,
) -> BatchFeature
Main method to prepare for the model one or several sequences(s) and audio(s).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
text | `str`, `List[str]` | The sequence or batch of sequences to be encoded. | None |
audio | `np.ndarray`, `List[np.ndarray]` | The audio or batch of audio to be prepared. Each audio can be a NumPy array. | None |
return_tensors | `str` | The type of tensors to return ("pt", "np", etc.) | 'pt' |
Source code in vllm/transformers_utils/processors/kimi_audio.py
check_argument_for_proper_class ¶
Override to skip class validation for custom tokenizer.
Source code in vllm/transformers_utils/processors/kimi_audio.py
_get_feat_extract_output_lengths ¶
Compute output lengths after Whisper feature extraction.