[Voxtral] Raise BadRequest for ref_audio (#7012)
Signed-off-by: Clodagh Walsh <clodaghwalsh17@gmail.com>
This commit is contained in:
1 parent
45a3e77351
commit
a1a234a0b4
7 files changed
+68
-4
No files matched your search
@@ -174,6 +174,11 @@ class VoxtralTTSForConditionalGeneration(
|
||||
return self.model.get_language_model()
|
||||
return self.model
|
||||
|
||||
def encoder_loaded(self):
|
||||
if self.audio_tokenizer is not None:
|
||||
return self.audio_tokenizer.encoder_loaded
|
||||
return False
|
||||
|
||||
def _enable_acoustic_transformer_cudagraph(self):
|
||||
"""Initialize and capture CUDA graphs for compute_mm_logits."""
|
||||
if self.model_stage != "audio_generation" or not hasattr(self, "_vllm_config"):
|
||||
|
||||
@@ -900,6 +900,10 @@ class VoxtralTTSAudioTokenizer(nn.Module):
|
||||
"""List of size of each codebook"""
|
||||
return self.quantizer.codebook_sizes
|
||||
|
||||
@property
|
||||
def encoder_loaded(self) -> bool:
|
||||
return self._encoder_loaded
|
||||
|
||||
def load_weight(self, weight: tuple[str, torch.Tensor]) -> str:
|
||||
params_dict = dict(self.named_parameters())
|
||||
name, loaded_weight = weight
|
||||
@@ -985,7 +989,7 @@ class VoxtralTTSAudioTokenizer(nn.Module):
|
||||
|
||||
def encode_waveforms(self, x: list[torch.Tensor]) -> list[torch.Tensor]:
|
||||
if not self._encoder_loaded:
|
||||
raise RuntimeError(
|
||||
raise ValueError(
|
||||
"encode_waveforms requires encoder weights which are not available in the open-source checkpoint."
|
||||
)
|
||||
audio_codes = []
|
||||
|
||||
Reference in new issue
Block a user