asahi417 commited on
Commit
cc0ba7a
·
1 Parent(s): c8c2430
attach_speaker_embedding_s2s.py CHANGED
@@ -60,7 +60,6 @@ print(f"Num examples (after filtering): {len(dataset)}")
60
 
61
  def speaker_embedding(example):
62
  for side in sides:
63
- print(example[f"{side}.audio"]["array"].shape)
64
  embedding = speaker_embedder.get_speaker_embedding(
65
  example[f"{side}.audio"]["array"], example[f"{side}.audio"]["sampling_rate"]
66
  )
 
60
 
61
  def speaker_embedding(example):
62
  for side in sides:
 
63
  embedding = speaker_embedder.get_speaker_embedding(
64
  example[f"{side}.audio"]["array"], example[f"{side}.audio"]["sampling_rate"]
65
  )
main_s2s.sh CHANGED
@@ -404,10 +404,12 @@ do
404
  python attach_speaker_embedding_s2s.py
405
  done
406
 
407
- export SE_MODEL="hubert-xl" # running
408
- export DATASET_ID=167
409
- export DIRECTION="enA-zhA"
410
- python attach_speaker_embedding_s2s.py
 
 
411
 
412
  export SE_MODEL="w2vbert-600m" # running
413
  export DATASET_ID=167
 
404
  python attach_speaker_embedding_s2s.py
405
  done
406
 
407
+ for i in 162 163 164 165 83 8;
408
+ do
409
+ export SE_MODEL="xlsr-2b" # running
410
+ export DIRECTION="enA-zhA"
411
+ python attach_speaker_embedding_s2s.py
412
+ done
413
 
414
  export SE_MODEL="w2vbert-600m" # running
415
  export DATASET_ID=167
tokenize_dataset_s2s.py CHANGED
@@ -17,6 +17,7 @@ hf_dataset = f"seamless-align-{direction}"
17
  dataset = load_dataset(f"{hf_org}/{hf_dataset}", f"subset_{dataset_id}", split="train")
18
  tokenizer = EncodecTokenizer.from_pretrained()
19
  max_seq_length = 10000000
 
20
  audio_loader = Audio()
21
 
22
 
@@ -24,7 +25,7 @@ def error_file(example):
24
  for side in sides:
25
  try:
26
  wav = audio_loader.decode_example(example[f"{side}.audio"])
27
- if len(wav["array"]) == 0 or len(wav["array"]) > max_seq_length:
28
  return False
29
  except ValueError:
30
  return False
 
17
  dataset = load_dataset(f"{hf_org}/{hf_dataset}", f"subset_{dataset_id}", split="train")
18
  tokenizer = EncodecTokenizer.from_pretrained()
19
  max_seq_length = 10000000
20
+ min_seq_length = 50000
21
  audio_loader = Audio()
22
 
23
 
 
25
  for side in sides:
26
  try:
27
  wav = audio_loader.decode_example(example[f"{side}.audio"])
28
+ if len(wav["array"]) < min_seq_length or len(wav["array"]) > max_seq_length:
29
  return False
30
  except ValueError:
31
  return False