Skip to content

Commit

Permalink
merge avsr
Browse files Browse the repository at this point in the history
  • Loading branch information
yanghaha0908 committed Jan 15, 2024
1 parent 79abbb8 commit 7c8525c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/llama_recipes/datasets/speech_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ def __len__(self):
def __getitem__(self, index):
data_dict = self.data_list[index]
audio_path = data_dict.get("source")
target = data_dict.get("target", None) #'ONE AH LITTLE RECKS THE LABORER HOW NEAR HIS WORK IS HOLDING HIM TO GOD THE LOVING LABORER THROUGH SPACE AND TIME AFTER ALL NOT TO CREATE ONLY OR FOUND ONLY'
task = data_dict.get("prompt", "ASR") #'<ASR>'
target = data_dict.get("target", None)
task = data_dict.get("prompt", "ASR")

audio_raw = whisper.load_audio(audio_path)
audio_raw = whisper.pad_or_trim(audio_raw)
Expand Down Expand Up @@ -151,7 +151,7 @@ def collator(self, samples):

audio_mask = torch.zeros_like(attention_mask)
for line, sample in enumerate(samples):
audio_mask[line, :sample['audio_length']] = 1 #downsample 再/5
audio_mask[line, :sample['audio_length']] = 1

return {
'input_ids': input_ids,
Expand Down
2 changes: 1 addition & 1 deletion src/llama_recipes/models/projector.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def forward(self, x):
seq_len = x.size(1)

x = x.contiguous()
x = x.view(batch_size, seq_len // self.k, dim * self.k)
x = x.view(batch_size, seq_len // self.k, dim * self.k)
x = self.linear1(x)
x = self.relu(x)
x = self.linear2(x)
Expand Down

0 comments on commit 7c8525c

Please sign in to comment.