init
Browse files- fetch_dataset_s2s.py +10 -5
- main_s2s.sh +12 -1
fetch_dataset_s2s.py
CHANGED
|
@@ -49,11 +49,16 @@ min_seq_length = 50000
|
|
| 49 |
|
| 50 |
def wget(url: str, output_file: Optional[str] = None):
|
| 51 |
os.makedirs(os.path.dirname(output_file), exist_ok=True)
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 57 |
if not os.path.exists(output_file):
|
| 58 |
return False
|
| 59 |
if output_file.endswith('.tar.gz') or output_file.endswith('.tgz') or output_file.endswith('.tar'):
|
|
|
|
| 49 |
|
| 50 |
def wget(url: str, output_file: Optional[str] = None):
|
| 51 |
os.makedirs(os.path.dirname(output_file), exist_ok=True)
|
| 52 |
+
try:
|
| 53 |
+
subprocess.check_output(
|
| 54 |
+
["wget", url, "-O", output_file, "--tries", wget_max_retry, "--timeout", wget_timeout],
|
| 55 |
+
stderr=subprocess.STDOUT,
|
| 56 |
+
timeout=int(60 * 5) # seconds (if it takes more than 5 min, skip it)
|
| 57 |
+
)
|
| 58 |
+
except Exception:
|
| 59 |
+
if not os.path.exists(output_file):
|
| 60 |
+
os.remove(output_file)
|
| 61 |
+
return False
|
| 62 |
if not os.path.exists(output_file):
|
| 63 |
return False
|
| 64 |
if output_file.endswith('.tar.gz') or output_file.endswith('.tgz') or output_file.endswith('.tar'):
|
main_s2s.sh
CHANGED
|
@@ -112,7 +112,18 @@ do
|
|
| 112 |
echo ${LINE_NO_START}
|
| 113 |
python fetch_dataset_s2s.py
|
| 114 |
done
|
| 115 |
-
for i in $(seq 500
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 116 |
do
|
| 117 |
export N_POOL=15
|
| 118 |
export DATASET_ID=${i}
|
|
|
|
| 112 |
echo ${LINE_NO_START}
|
| 113 |
python fetch_dataset_s2s.py
|
| 114 |
done
|
| 115 |
+
for i in $(seq 500 514);
|
| 116 |
+
do
|
| 117 |
+
export N_POOL=15
|
| 118 |
+
export DATASET_ID=${i}
|
| 119 |
+
export DIRECTION="enA-esA"
|
| 120 |
+
export LINE_NO_START=$(((DATASET_ID-1) * 2500))
|
| 121 |
+
export LINE_NO_END=$((DATASET_ID * 2500))
|
| 122 |
+
echo ${LINE_NO_START}
|
| 123 |
+
python fetch_dataset_s2s.py
|
| 124 |
+
done
|
| 125 |
+
|
| 126 |
+
for i in $(seq 515 532);
|
| 127 |
do
|
| 128 |
export N_POOL=15
|
| 129 |
export DATASET_ID=${i}
|