asahi417 commited on
Commit
6dd6701
1 Parent(s): af5bf83
Files changed (2) hide show
  1. main.sh +2 -3
  2. push_s2s_translation.py +11 -8
main.sh CHANGED
@@ -7,6 +7,7 @@ export LINE_NO_START=0
7
  export LINE_NO_END=25000
8
  python download_audio.py
9
 
 
10
  export LINE_NO_START=25000
11
  export LINE_NO_END=50000
12
  python download_audio.py
@@ -62,9 +63,7 @@ python download_audio.py
62
  export LINE_NO_START=350000
63
  export LINE_NO_END=360000
64
  python download_audio.py
65
-
66
-
67
-
68
 
69
  ######################
70
  # enA-jpn: 1_468_292 #
 
7
  export LINE_NO_END=25000
8
  python download_audio.py
9
 
10
+
11
  export LINE_NO_START=25000
12
  export LINE_NO_END=50000
13
  python download_audio.py
 
63
  export LINE_NO_START=350000
64
  export LINE_NO_END=360000
65
  python download_audio.py
66
+ python push_s2s_translation.py
 
 
67
 
68
  ######################
69
  # enA-jpn: 1_468_292 #
push_s2s_translation.py CHANGED
@@ -68,14 +68,17 @@ for i in tqdm(range(len(audio_dataset))):
68
  broken_files.append(i)
69
  continue
70
  print(f"features (removed broken audio): {len(audio_dataset) - len(broken_files)}")
71
-
72
- # remove broken files
73
- for i in broken_files:
74
- if os.path.exists(files[file_ids[i]]):
75
- os.remove(files[file_ids[i]])
76
- for side_id in sides_rev.keys():
77
- if os.path.exists(data_dict[f"{sides_rev[side_id]}.audio"][i]):
78
- os.remove(data_dict[f"{sides_rev[side_id]}.audio"][i])
 
 
 
79
  valid_data_id = [i for i in range(len(audio_dataset)) if i not in broken_files]
80
  audio_dataset_valid = audio_dataset.select(valid_data_id)
81
 
 
68
  broken_files.append(i)
69
  continue
70
  print(f"features (removed broken audio): {len(audio_dataset) - len(broken_files)}")
71
+ if len(broken_files) > 0:
72
+ print(f"found {len(broken_files)} broken files:")
73
+ flag = input("delete the broken files? (y/n): ")
74
+ if flag == "y":
75
+ # remove broken files
76
+ for i in broken_files:
77
+ if os.path.exists(files[file_ids[i]]):
78
+ os.remove(files[file_ids[i]])
79
+ for side_id in sides_rev.keys():
80
+ if os.path.exists(data_dict[f"{sides_rev[side_id]}.audio"][i]):
81
+ os.remove(data_dict[f"{sides_rev[side_id]}.audio"][i])
82
  valid_data_id = [i for i in range(len(audio_dataset)) if i not in broken_files]
83
  audio_dataset_valid = audio_dataset.select(valid_data_id)
84