-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathentrypoint_data.py
More file actions
39 lines (26 loc) · 1.1 KB
/
entrypoint_data.py
File metadata and controls
39 lines (26 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import argparse
import os
def create_file(file_name):
with open(file_name, 'w') as outfile:
outfile.write(f'1. Created dataset file {file_name}.\n')
def materialize_dataset(output_dir, name):
# Create the output directory if it doesn't exist
os.makedirs(output_dir, exist_ok=True)
# Create dataset files
data_counts_file = os.path.join(output_dir, f'{name}.txt.gz')
data_meta_file = os.path.join(output_dir, f'{name}.meta.json')
data_specific_params_file = os.path.join(output_dir, f'{name}_params.txt')
create_file(data_counts_file)
create_file(data_meta_file)
create_file(data_specific_params_file)
def main():
# Create argument parser
parser = argparse.ArgumentParser(description='Materialize dataset files.')
# Add arguments
parser.add_argument('--output_dir', type=str, help='output directory where dataset files will be saved.')
parser.add_argument('--name', type=str, help='name of the dataset')
# Parse arguments
args = parser.parse_args()
materialize_dataset(args.output_dir, args.name)
if __name__ == "__main__":
main()