File tree Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Original file line number Diff line number Diff line change 11import json
22import csv
33
4- with open ('../datasets/sql/repository-5k.jsonl' , 'r' ) as f :
4+ type_map = {}
5+ # open datasets/sql/types.json
6+
7+
8+ # open datasets/sql/prompts.json
9+ # create id map for prompts in datasets/sql/prompts.json
10+ id_prompt_map = {}
11+ with open ('../datasets/sql/prompts.json' , 'r' ) as f :
12+ data = json .loads (f .read ())
13+ for row in data :
14+ id_prompt_map [row ['id' ]] = row ['prompt' ]
15+
16+
17+ with open ('../datasets/sql/repositories-5k.jsonl' , 'r' ) as f :
518 data = [json .loads (row ) for row in f .readlines ()]
619
720 with open ('../datasets/sql/repository-5k-train.jsonl' , 'w' ) as f :
821 for row in data :
22+ print (row )
23+ id = int (row ['id' ])
924 item = {
10- 'instruction' : 'text to kotlin repository' ,
25+ 'instruction' : 'text to kotlin repository with class ' ,
1126 'input' : row ['output' ],
1227 'output' : row ['input' ]
1328 }
Load Diff Large diffs are not rendered by default.
You can’t perform that action at this time.
0 commit comments