-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchoice_bench.py
48 lines (36 loc) · 1.04 KB
/
choice_bench.py
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
40
41
42
43
44
45
46
from bench_function import choice_test, get_api_key, export_distribute_json, export_union_json
import os
import json
import time
if __name__ == "__main__":
with open("MCQ_prompt.json", "r") as f:
data = json.load(f)
f.close()
for i in range(len(data['examples'])):
directory = "../data"
api_key_filename = "your_api_key.txt"
api_key_list = get_api_key(api_key_filename, start_num=0, end_num = 1)
model_name = 'gpt-3.5-turbo'
temperature = 0.3
keyword = data['examples'][i]['keyword']
question_type = data['examples'][i]['type']
zero_shot_prompt_text = data['examples'][i]['prefix_prompt']
print(keyword)
print(question_type)
export_distribute_json(
api_key_list,
model_name,
temperature,
directory,
keyword,
zero_shot_prompt_text,
question_type,
parallel_num=5
)
export_union_json(
directory,
model_name,
keyword,
zero_shot_prompt_text,
question_type
)