Skip to content

Commit bc77a1b

Browse files
committed
docs: try to add prompts types
1 parent e0751b6 commit bc77a1b

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

code/text-to-repository.py

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,28 @@
11
import json
22
import 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
}

datasets/sql/types.json

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)