asahi417 commited on
Commit
d194fbb
·
1 Parent(s): 1ab2e75
Files changed (2) hide show
  1. filter_audio.py → filter_audio_s2t.py +2 -16
  2. main.sh +12 -12
filter_audio.py → filter_audio_s2t.py RENAMED
@@ -23,8 +23,8 @@ line_no_end = int(os.getenv("LINE_NO_END", 100))
23
 
24
 
25
  def loader(feature: str) -> Dict:
26
- with open(feature) as f:
27
- return json.load(f)
28
 
29
 
30
  # feature dictionary
@@ -53,17 +53,3 @@ for i in tqdm(index_list):
53
  except Exception as e:
54
  print(e)
55
  os.remove(audio_file)
56
-
57
- #
58
- # print(f"features (filtered): {len(features)}")
59
- # dataset_to_push = DatasetDict({"train": audio_dataset})
60
- # repo_name = f"{hf_org}/{hf_dataset}"
61
- # while True:
62
- # try:
63
- # dataset_to_push.push_to_hub(repo_name, config_name=f"subset_{dataset_id}")
64
- # break
65
- # except Exception:
66
- # print(f"FAILED: push_to_hub on {repo_name} failed. wait 60 sec and retry soon...")
67
- # time.sleep(60)
68
- # json.dump(data_dict["line_no"], f)
69
- # f_writer.close()
 
23
 
24
 
25
  def loader(feature: str) -> Dict:
26
+ with open(feature) as f_reader:
27
+ return json.load(f_reader)
28
 
29
 
30
  # feature dictionary
 
53
  except Exception as e:
54
  print(e)
55
  os.remove(audio_file)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
main.sh CHANGED
@@ -144,50 +144,50 @@ export LINE_NO_END=100
144
  export LINE_NO_START=0
145
  export LINE_NO_END=25000
146
  export DATASET_ID="1"
147
- python push_s2t_translation.py
148
 
149
  export LINE_NO_START=25000
150
  export LINE_NO_END=50000
151
  export DATASET_ID="2"
152
- python push_s2t_translation.py
153
 
154
  export LINE_NO_START=50000
155
  export LINE_NO_END=75000
156
  export DATASET_ID="3"
157
- python push_s2t_translation.py
158
 
159
  export LINE_NO_START=75000
160
  export LINE_NO_END=100000
161
  export DATASET_ID="4"
162
- python push_s2t_translation.py
163
 
164
  export LINE_NO_START=100000
165
  export LINE_NO_END=125000
166
  export DATASET_ID="5"
167
- python push_s2t_translation.py
168
 
169
  export LINE_NO_START=125000
170
  export LINE_NO_END=150000
171
  export DATASET_ID="6"
172
- python push_s2t_translation.py
173
 
174
  export LINE_NO_START=150000
175
  export LINE_NO_END=175000
176
  export DATASET_ID="7"
177
- python push_s2t_translation.py
178
 
179
  export LINE_NO_START=175000
180
  export LINE_NO_END=200000
181
  export DATASET_ID="8"
182
- python push_s2t_translation.py
183
 
184
 
185
 
186
 
187
- export LINE_NO_START=100000
188
- export LINE_NO_END=150000
189
- export DATASET_ID="0"
190
- python push_s2t_translation.py
191
 
192
 
193
  export LINE_NO_START=150000
 
144
  export LINE_NO_START=0
145
  export LINE_NO_END=25000
146
  export DATASET_ID="1"
147
+ python filter_audio_s2t.py
148
 
149
  export LINE_NO_START=25000
150
  export LINE_NO_END=50000
151
  export DATASET_ID="2"
152
+ python filter_audio_s2t.py
153
 
154
  export LINE_NO_START=50000
155
  export LINE_NO_END=75000
156
  export DATASET_ID="3"
157
+ python filter_audio_s2t.py
158
 
159
  export LINE_NO_START=75000
160
  export LINE_NO_END=100000
161
  export DATASET_ID="4"
162
+ python filter_audio_s2t.py
163
 
164
  export LINE_NO_START=100000
165
  export LINE_NO_END=125000
166
  export DATASET_ID="5"
167
+ python filter_audio_s2t.py
168
 
169
  export LINE_NO_START=125000
170
  export LINE_NO_END=150000
171
  export DATASET_ID="6"
172
+ python filter_audio_s2t.py
173
 
174
  export LINE_NO_START=150000
175
  export LINE_NO_END=175000
176
  export DATASET_ID="7"
177
+ python filter_audio_s2t.py
178
 
179
  export LINE_NO_START=175000
180
  export LINE_NO_END=200000
181
  export DATASET_ID="8"
182
+ python filter_audio_s2t.py
183
 
184
 
185
 
186
 
187
+ export LINE_NO_START=200000
188
+ export LINE_NO_END=225000
189
+ export DATASET_ID="9"
190
+ python filter_audio_s2t.py
191
 
192
 
193
  export LINE_NO_START=150000