asahi417 commited on
Commit
eabf3d6
·
1 Parent(s): 4317bcb
Files changed (2) hide show
  1. download_audio.py +1 -2
  2. main.sh +2 -1
download_audio.py CHANGED
@@ -93,7 +93,6 @@ def to_json_serializable(val):
93
 
94
 
95
  def cleanup(features, feature_file):
96
- os.remove(features[f"{side}.path"])
97
  if os.path.exists(feature_file):
98
  os.remove(feature_file)
99
  for _side in sides:
@@ -101,7 +100,7 @@ def cleanup(features, feature_file):
101
  os.remove(features[f"{_side}.path"])
102
  # create a dummy so that we can skip from next run
103
  with open(feature_file, "w") as f:
104
- json.dump({"dummy": "dummy"})
105
 
106
 
107
  def get_audio(dataframe: pd.DataFrame):
 
93
 
94
 
95
  def cleanup(features, feature_file):
 
96
  if os.path.exists(feature_file):
97
  os.remove(feature_file)
98
  for _side in sides:
 
100
  os.remove(features[f"{_side}.path"])
101
  # create a dummy so that we can skip from next run
102
  with open(feature_file, "w") as f:
103
+ json.dump({"dummy": "dummy"}, f)
104
 
105
 
106
  def get_audio(dataframe: pd.DataFrame):
main.sh CHANGED
@@ -3,6 +3,7 @@ rm -rf download/audio
3
  rm -rf download/feature
4
  python -c 'n=41; import os; from glob import glob; tmp = [int(os.path.basename(i).split(".")[0]) for i in glob("download/feature/enA-jaA/*.json")]; print(len([x for x in tmp if (n-1) * 2500 <= x < n * 2500]))'
5
  python -c 'n=41; import os; from glob import glob; tmp = [int(os.path.basename(i).split(".")[0]) for i in glob("download/audio/enA-jaA/enA/*")]; print(len([x for x in tmp if (n-1) * 2500 <= x < n * 2500]))'
 
6
  python -c 'file_name="download/audio/enA-jaA/jaA/100020.mp3"; from datasets import Audio; a=Audio(); wav=a.decode_example({"path": file_name, "bytes": None}): print(wav)'
7
  ####################
8
  # enA-jaA: 718_606 #
@@ -59,7 +60,7 @@ done
59
  # kotoba-4
60
  for i in $(seq 41 50);
61
  do
62
- export N_POOL=40
63
  export DATASET_ID=${i}
64
  export DIRECTION="enA-jaA"
65
  export LINE_NO_START=$(((DATASET_ID-1) * 2500))
 
3
  rm -rf download/feature
4
  python -c 'n=41; import os; from glob import glob; tmp = [int(os.path.basename(i).split(".")[0]) for i in glob("download/feature/enA-jaA/*.json")]; print(len([x for x in tmp if (n-1) * 2500 <= x < n * 2500]))'
5
  python -c 'n=41; import os; from glob import glob; tmp = [int(os.path.basename(i).split(".")[0]) for i in glob("download/audio/enA-jaA/enA/*")]; print(len([x for x in tmp if (n-1) * 2500 <= x < n * 2500]))'
6
+ python -c 'n=41; import os; from glob import glob; tmp = [int(os.path.basename(i).split(".")[0]) for i in glob("download/audio/enA-jaA/jaA/*")]; print(len([x for x in tmp if (n-1) * 2500 <= x < n * 2500]))'
7
  python -c 'file_name="download/audio/enA-jaA/jaA/100020.mp3"; from datasets import Audio; a=Audio(); wav=a.decode_example({"path": file_name, "bytes": None}): print(wav)'
8
  ####################
9
  # enA-jaA: 718_606 #
 
60
  # kotoba-4
61
  for i in $(seq 41 50);
62
  do
63
+ export N_POOL=10
64
  export DATASET_ID=${i}
65
  export DIRECTION="enA-jaA"
66
  export LINE_NO_START=$(((DATASET_ID-1) * 2500))