alex-ht commited on
Commit
7f2cfee
1 Parent(s): 09c54e5
Files changed (1) hide show
  1. ultravox_model.py +1 -0
ultravox_model.py CHANGED
@@ -202,6 +202,7 @@ class UltravoxModel(transformers.LlamaPreTrainedModel):
202
  zip(audio_embeds, audio_token_start_idx, audio_token_len)
203
  ):
204
  length = min(length, audio.shape[0])
 
205
  inputs_embeds[i, start : start + length] = audio[:length]
206
 
207
  lm_output = self.language_model.forward(
 
202
  zip(audio_embeds, audio_token_start_idx, audio_token_len)
203
  ):
204
  length = min(length, audio.shape[0])
205
+ length = min(inputs_embeds.shape[1] - start, length)
206
  inputs_embeds[i, start : start + length] = audio[:length]
207
 
208
  lm_output = self.language_model.forward(