asahi417 commited on
Commit
ea85278
1 Parent(s): 797cdbd
Files changed (3) hide show
  1. main_s2s.sh +91 -60
  2. main_s2t.sh +22 -8
  3. tokenizer_encodec.py +1 -0
main_s2s.sh CHANGED
@@ -8,7 +8,7 @@ export LINE_NO_START=0
8
  export LINE_NO_END=10
9
  python fetch_dataset_s2s.py
10
  # main
11
- for i in $(seq 1 50);
12
  do
13
  export N_POOL=15
14
  export DATASET_ID=${i}
@@ -18,7 +18,7 @@ do
18
  echo ${LINE_NO_START}
19
  python fetch_dataset_s2s.py
20
  done
21
- for i in $(seq 51 100);
22
  do
23
  export N_POOL=15
24
  export DATASET_ID=${i}
@@ -29,7 +29,7 @@ do
29
  python fetch_dataset_s2s.py
30
  done
31
  # tokenize
32
- for i in $(seq 1 20);
33
  do
34
  export N_POOL=15
35
  export DATASET_ID=${i}
@@ -39,7 +39,7 @@ do
39
  echo ${LINE_NO_START}
40
  python tokenize_dataset_s2s.py
41
  done
42
- for i in $(seq 51 64);
43
  do
44
  export N_POOL=15
45
  export DATASET_ID=${i}
@@ -64,54 +64,36 @@ do
64
  done
65
 
66
  ######################
67
- # enA-zhA: 1_289_192 #
68
  ######################
69
  # test
70
  export DATASET_ID=test
71
- export DIRECTION="enA-zhA"
72
  export LINE_NO_START=0
73
  export LINE_NO_END=10
74
  python fetch_dataset_s2s.py
75
  # main
76
- for i in $(seq 1 258);
77
  do
78
  export N_POOL=15
79
  export DATASET_ID=${i}
80
- export DIRECTION="enA-zhA"
81
  export LINE_NO_START=$(((DATASET_ID-1) * 2500))
82
  export LINE_NO_END=$((DATASET_ID * 2500))
83
  echo ${LINE_NO_START}
84
  python fetch_dataset_s2s.py
85
  done
86
- # tokenize
87
- for i in $(seq 101 150);
88
  do
89
  export N_POOL=15
90
  export DATASET_ID=${i}
91
- export DIRECTION="enA-zhA"
92
  export LINE_NO_START=$(((DATASET_ID-1) * 2500))
93
  export LINE_NO_END=$((DATASET_ID * 2500))
94
  echo ${LINE_NO_START}
95
- python tokenize_dataset_s2s.py
96
- done
97
- # speaker embedding
98
- for i in $(seq 101 150);
99
- do
100
- export DATASET_ID=${i}
101
- export DIRECTION="enA-zhA"
102
- python attach_speaker_embedding_s2s.py
103
  done
104
- ######################
105
- # enA-frA: 3_054_258 #
106
- ######################
107
- # test
108
- export DATASET_ID=test
109
- export DIRECTION="enA-frA"
110
- export LINE_NO_START=0
111
- export LINE_NO_END=10
112
- python fetch_dataset_s2s.py
113
- # main
114
- for i in $(seq 1 300);
115
  do
116
  export N_POOL=15
117
  export DATASET_ID=${i}
@@ -121,7 +103,7 @@ do
121
  echo ${LINE_NO_START}
122
  python fetch_dataset_s2s.py
123
  done
124
- for i in $(seq 300 600);
125
  do
126
  export N_POOL=15
127
  export DATASET_ID=${i}
@@ -132,7 +114,7 @@ do
132
  python fetch_dataset_s2s.py
133
  done
134
  # tokenize
135
- for i in $(seq 31 60);
136
  do
137
  export N_POOL=15
138
  export DATASET_ID=${i}
@@ -142,7 +124,15 @@ do
142
  echo ${LINE_NO_START}
143
  python tokenize_dataset_s2s.py
144
  done
145
- for i in $(seq 331 360);
 
 
 
 
 
 
 
 
146
  do
147
  export N_POOL=15
148
  export DATASET_ID=${i}
@@ -153,19 +143,14 @@ do
153
  python tokenize_dataset_s2s.py
154
  done
155
  # speaker embedding
156
- for i in $(seq 31 60);
157
- do
158
- export DATASET_ID=${i}
159
- export DIRECTION="enA-frA"
160
- python attach_speaker_embedding_s2s.py
161
- done
162
- # speaker embedding
163
- for i in $(seq 331 360);
164
  do
165
  export DATASET_ID=${i}
166
  export DIRECTION="enA-frA"
167
  python attach_speaker_embedding_s2s.py
168
  done
 
 
169
  ######################
170
  # enA-deA: 1_965_186 #
171
  ######################
@@ -197,18 +182,7 @@ do
197
  python fetch_dataset_s2s.py
198
  done
199
  # tokenize
200
- for i in 215 216 232;
201
- do
202
- export N_POOL=15
203
- export DATASET_ID=${i}
204
- export DIRECTION="deA-enA"
205
- export LINE_NO_START=$(((DATASET_ID-1) * 2500))
206
- export LINE_NO_END=$((DATASET_ID * 2500))
207
- echo ${LINE_NO_START}
208
- python tokenize_dataset_s2s.py
209
-
210
- done
211
- for i in $(seq 21 50);
212
  do
213
  export N_POOL=15
214
  export DATASET_ID=${i}
@@ -218,7 +192,7 @@ do
218
  echo ${LINE_NO_START}
219
  python tokenize_dataset_s2s.py
220
  done
221
- for i in $(seq 241 290);
222
  do
223
  export N_POOL=15
224
  export DATASET_ID=${i}
@@ -229,14 +203,14 @@ do
229
  python tokenize_dataset_s2s.py
230
  done
231
  # speaker embedding
232
- for i in $(seq 21 50);
233
  do
234
  export DATASET_ID=${i}
235
  export DIRECTION="deA-enA"
236
  python attach_speaker_embedding_s2s.py
237
  done
238
  # speaker embedding
239
- for i in $(seq 241 290);
240
  do
241
  export DATASET_ID=${i}
242
  export DIRECTION="deA-enA"
@@ -252,7 +226,7 @@ export LINE_NO_START=0
252
  export LINE_NO_END=10
253
  python fetch_dataset_s2s.py
254
  # main
255
- for i in $(seq 1 250);
256
  do
257
  export N_POOL=15
258
  export DATASET_ID=${i}
@@ -262,7 +236,27 @@ do
262
  echo ${LINE_NO_START}
263
  python fetch_dataset_s2s.py
264
  done
265
- for i in $(seq 251 532);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
266
  do
267
  export N_POOL=15
268
  export DATASET_ID=${i}
@@ -272,7 +266,6 @@ do
272
  echo ${LINE_NO_START}
273
  python fetch_dataset_s2s.py
274
  done
275
-
276
  # tokenize
277
  for i in $(seq 1 50);
278
  do
@@ -291,7 +284,6 @@ do
291
  export DIRECTION="enA-esA"
292
  python attach_speaker_embedding_s2s.py
293
  done
294
-
295
  # tokenize
296
  for i in $(seq 251 280);
297
  do
@@ -312,6 +304,45 @@ do
312
  done
313
 
314
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
315
  ####################
316
  # enA-jaA: 718_606 #
317
  ####################
 
8
  export LINE_NO_END=10
9
  python fetch_dataset_s2s.py
10
  # main
11
+ for i in $(seq 34 50);
12
  do
13
  export N_POOL=15
14
  export DATASET_ID=${i}
 
18
  echo ${LINE_NO_START}
19
  python fetch_dataset_s2s.py
20
  done
21
+ for i in $(seq 73 100);
22
  do
23
  export N_POOL=15
24
  export DATASET_ID=${i}
 
29
  python fetch_dataset_s2s.py
30
  done
31
  # tokenize
32
+ for i in $(seq 21 36);
33
  do
34
  export N_POOL=15
35
  export DATASET_ID=${i}
 
39
  echo ${LINE_NO_START}
40
  python tokenize_dataset_s2s.py
41
  done
42
+ for i in $(seq 65 75);
43
  do
44
  export N_POOL=15
45
  export DATASET_ID=${i}
 
64
  done
65
 
66
  ######################
67
+ # enA-frA: 3_054_258 #
68
  ######################
69
  # test
70
  export DATASET_ID=test
71
+ export DIRECTION="enA-frA"
72
  export LINE_NO_START=0
73
  export LINE_NO_END=10
74
  python fetch_dataset_s2s.py
75
  # main
76
+ for i in $(seq 106 200);
77
  do
78
  export N_POOL=15
79
  export DATASET_ID=${i}
80
+ export DIRECTION="enA-frA"
81
  export LINE_NO_START=$(((DATASET_ID-1) * 2500))
82
  export LINE_NO_END=$((DATASET_ID * 2500))
83
  echo ${LINE_NO_START}
84
  python fetch_dataset_s2s.py
85
  done
86
+ for i in $(seq 201 300);
 
87
  do
88
  export N_POOL=15
89
  export DATASET_ID=${i}
90
+ export DIRECTION="enA-frA"
91
  export LINE_NO_START=$(((DATASET_ID-1) * 2500))
92
  export LINE_NO_END=$((DATASET_ID * 2500))
93
  echo ${LINE_NO_START}
94
+ python fetch_dataset_s2s.py
 
 
 
 
 
 
 
95
  done
96
+ for i in $(seq 427 500);
 
 
 
 
 
 
 
 
 
 
97
  do
98
  export N_POOL=15
99
  export DATASET_ID=${i}
 
103
  echo ${LINE_NO_START}
104
  python fetch_dataset_s2s.py
105
  done
106
+ for i in $(seq 500 600);
107
  do
108
  export N_POOL=15
109
  export DATASET_ID=${i}
 
114
  python fetch_dataset_s2s.py
115
  done
116
  # tokenize
117
+ for i in $(seq 61 105);
118
  do
119
  export N_POOL=15
120
  export DATASET_ID=${i}
 
124
  echo ${LINE_NO_START}
125
  python tokenize_dataset_s2s.py
126
  done
127
+ # speaker embedding
128
+ for i in $(seq 61 105);
129
+ do
130
+ export DATASET_ID=${i}
131
+ export DIRECTION="enA-frA"
132
+ python attach_speaker_embedding_s2s.py
133
+ done
134
+ # tokenize
135
+ for i in $(seq 361 425);
136
  do
137
  export N_POOL=15
138
  export DATASET_ID=${i}
 
143
  python tokenize_dataset_s2s.py
144
  done
145
  # speaker embedding
146
+ for i in $(seq 361 425);
 
 
 
 
 
 
 
147
  do
148
  export DATASET_ID=${i}
149
  export DIRECTION="enA-frA"
150
  python attach_speaker_embedding_s2s.py
151
  done
152
+
153
+
154
  ######################
155
  # enA-deA: 1_965_186 #
156
  ######################
 
182
  python fetch_dataset_s2s.py
183
  done
184
  # tokenize
185
+ for i in $(seq 51 104);
 
 
 
 
 
 
 
 
 
 
 
186
  do
187
  export N_POOL=15
188
  export DATASET_ID=${i}
 
192
  echo ${LINE_NO_START}
193
  python tokenize_dataset_s2s.py
194
  done
195
+ for i in $(seq 370 394);
196
  do
197
  export N_POOL=15
198
  export DATASET_ID=${i}
 
203
  python tokenize_dataset_s2s.py
204
  done
205
  # speaker embedding
206
+ for i in $(seq 28 104);
207
  do
208
  export DATASET_ID=${i}
209
  export DIRECTION="deA-enA"
210
  python attach_speaker_embedding_s2s.py
211
  done
212
  # speaker embedding
213
+ for i in $(seq 370 394);
214
  do
215
  export DATASET_ID=${i}
216
  export DIRECTION="deA-enA"
 
226
  export LINE_NO_END=10
227
  python fetch_dataset_s2s.py
228
  # main
229
+ for i in $(seq 54 125);
230
  do
231
  export N_POOL=15
232
  export DATASET_ID=${i}
 
236
  echo ${LINE_NO_START}
237
  python fetch_dataset_s2s.py
238
  done
239
+ for i in $(seq 126 250);
240
+ do
241
+ export N_POOL=15
242
+ export DATASET_ID=${i}
243
+ export DIRECTION="enA-esA"
244
+ export LINE_NO_START=$(((DATASET_ID-1) * 2500))
245
+ export LINE_NO_END=$((DATASET_ID * 2500))
246
+ echo ${LINE_NO_START}
247
+ python fetch_dataset_s2s.py
248
+ done
249
+ for i in $(seq 320 420);
250
+ do
251
+ export N_POOL=15
252
+ export DATASET_ID=${i}
253
+ export DIRECTION="enA-esA"
254
+ export LINE_NO_START=$(((DATASET_ID-1) * 2500))
255
+ export LINE_NO_END=$((DATASET_ID * 2500))
256
+ echo ${LINE_NO_START}
257
+ python fetch_dataset_s2s.py
258
+ done
259
+ for i in $(seq 421 532);
260
  do
261
  export N_POOL=15
262
  export DATASET_ID=${i}
 
266
  echo ${LINE_NO_START}
267
  python fetch_dataset_s2s.py
268
  done
 
269
  # tokenize
270
  for i in $(seq 1 50);
271
  do
 
284
  export DIRECTION="enA-esA"
285
  python attach_speaker_embedding_s2s.py
286
  done
 
287
  # tokenize
288
  for i in $(seq 251 280);
289
  do
 
304
  done
305
 
306
 
307
+
308
+ ######################
309
+ # enA-zhA: 1_289_192 #
310
+ ######################
311
+ # test
312
+ export DATASET_ID=test
313
+ export DIRECTION="enA-zhA"
314
+ export LINE_NO_START=0
315
+ export LINE_NO_END=10
316
+ python fetch_dataset_s2s.py
317
+ # main
318
+ for i in $(seq 1 258);
319
+ do
320
+ export N_POOL=15
321
+ export DATASET_ID=${i}
322
+ export DIRECTION="enA-zhA"
323
+ export LINE_NO_START=$(((DATASET_ID-1) * 2500))
324
+ export LINE_NO_END=$((DATASET_ID * 2500))
325
+ echo ${LINE_NO_START}
326
+ python fetch_dataset_s2s.py
327
+ done
328
+ # tokenize
329
+ for i in $(seq 1 258);
330
+ do
331
+ export N_POOL=15
332
+ export DATASET_ID=${i}
333
+ export DIRECTION="enA-zhA"
334
+ export LINE_NO_START=$(((DATASET_ID-1) * 2500))
335
+ export LINE_NO_END=$((DATASET_ID * 2500))
336
+ echo ${LINE_NO_START}
337
+ python tokenize_dataset_s2s.py
338
+ done
339
+ # speaker embedding
340
+ for i in $(seq 1 258);
341
+ do
342
+ export DATASET_ID=${i}
343
+ export DIRECTION="enA-zhA"
344
+ python attach_speaker_embedding_s2s.py
345
+ done
346
  ####################
347
  # enA-jaA: 718_606 #
348
  ####################
main_s2t.sh CHANGED
@@ -22,9 +22,23 @@ alias wet_lines="${PWD}/bin/wet_lines"
22
  cd ../../
23
 
24
 
25
- ######################
26
- # enA-est: 734_146 #
27
- ######################
 
 
 
 
 
 
 
 
 
 
 
 
 
 
28
  # text
29
  export DIRECTION_SPEECH="enA"
30
  export DIRECTION_TEXT="est"
@@ -36,7 +50,7 @@ do
36
  done
37
  python format_text.py
38
  # audio
39
- for i in $(seq 1 300);
40
  do
41
  export N_POOL=15
42
  export DATASET_ID=${i}
@@ -49,9 +63,9 @@ do
49
  done
50
 
51
 
52
- ######################
53
- # enA-jpn: 734_146 #
54
- ######################
55
  # text
56
  export DIRECTION_SPEECH="enA"
57
  export DIRECTION_TEXT="jpn"
@@ -63,7 +77,7 @@ do
63
  done
64
  python format_text.py
65
  # audio
66
- for i in $(seq 1 294);
67
  do
68
  export N_POOL=15
69
  export DATASET_ID=${i}
 
22
  cd ../../
23
 
24
 
25
+ ###########
26
+ # enA-vie #
27
+ ###########
28
+ # text
29
+ export DIRECTION_SPEECH="enA"
30
+ export DIRECTION_TEXT="vie"
31
+ export CHUNK_SIZE=20
32
+ python download_s2t_metadata.py
33
+ for i in $(seq 1 ${CHUNK_SIZE});
34
+ do
35
+ cat seamless.dataset.metadata.public.${DIRECTION_SPEECH}-${DIRECTION_TEXT}.withduration.reordered.batch_${i}.tsv | egrep ^crawl-data | tr '\t' ' ' | wet_lines | tee metadata.${DIRECTION_SPEECH}-${DIRECTION_TEXT}.batch_${i}.tsv &
36
+ done
37
+ python format_text.py
38
+
39
+ ###########
40
+ # enA-est #
41
+ ###########
42
  # text
43
  export DIRECTION_SPEECH="enA"
44
  export DIRECTION_TEXT="est"
 
50
  done
51
  python format_text.py
52
  # audio
53
+ for i in $(seq 19 300);
54
  do
55
  export N_POOL=15
56
  export DATASET_ID=${i}
 
63
  done
64
 
65
 
66
+ ###########
67
+ # enA-jpn #
68
+ ###########
69
  # text
70
  export DIRECTION_SPEECH="enA"
71
  export DIRECTION_TEXT="jpn"
 
77
  done
78
  python format_text.py
79
  # audio
80
+ for i in $(seq 233 294);
81
  do
82
  export N_POOL=15
83
  export DATASET_ID=${i}
tokenizer_encodec.py CHANGED
@@ -87,6 +87,7 @@ class BaseEncodecTokenizer:
87
  # tokenize by chunk in a sequential manner
88
  for offset in tqdm(list(range(0, input_length - chunk_length + stride, stride))):
89
  frame = wav[:, :1, offset: offset + chunk_length]
 
90
  tmp_tokens, _ = self.codec_model.encode(frame.to(self.device))
91
  offset_latent = int(offset / self.sample_per_token)
92
  tmp_tokens = tmp_tokens.to("cpu") if cpu_offload else tmp_tokens.to(original_device)
 
87
  # tokenize by chunk in a sequential manner
88
  for offset in tqdm(list(range(0, input_length - chunk_length + stride, stride))):
89
  frame = wav[:, :1, offset: offset + chunk_length]
90
+ print(frame.shape)
91
  tmp_tokens, _ = self.codec_model.encode(frame.to(self.device))
92
  offset_latent = int(offset / self.sample_per_token)
93
  tmp_tokens = tmp_tokens.to("cpu") if cpu_offload else tmp_tokens.to(original_device)