AlexHung29629 commited on
Commit
a7be3b8
·
verified ·
1 Parent(s): 6f9768a

Update ultravox_model.py

Browse files
Files changed (1) hide show
  1. ultravox_model.py +2 -1
ultravox_model.py CHANGED
@@ -201,7 +201,8 @@ class UltravoxModel(transformers.LlamaPreTrainedModel):
201
  for i, (audio, start, length) in enumerate(
202
  zip(audio_embeds, audio_token_start_idx, audio_token_len)
203
  ):
204
- inputs_embeds[i, start : start + length] = audio[:length]
 
205
 
206
 
207
  lm_output = self.language_model.forward(
 
201
  for i, (audio, start, length) in enumerate(
202
  zip(audio_embeds, audio_token_start_idx, audio_token_len)
203
  ):
204
+ assert length <= audio.shape[0]
205
+ inputs_embeds[i, start : start + length].copy_(audio[:length])
206
 
207
 
208
  lm_output = self.language_model.forward(