-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathevalset_prepare.py
More file actions
55 lines (46 loc) · 3.17 KB
/
evalset_prepare.py
File metadata and controls
55 lines (46 loc) · 3.17 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
import asyncio
from chatgpt import ChatGPTEval
from gpt4 import GPT4Eval
async def arun(self, obj: dict) -> dict:
if 'instances' in obj.keys():
for idx, instance in enumerate(obj['instances']):
obj['instances'][idx]['output'] = await self.__call__(obj['instruction'], instance['input'])
else:
obj['answer'] = await self.__call__(obj['instruction'], obj['input'])
return obj
# ChatGPT API를 사용하여 'user_oriented_instructions_deepl_ko.jsonl' 파일에 답변하고, 'user_oriented_instructions_deepl_ko_eval_chatgpt.jsonl' 파일에 저장합니다.
asyncio.run(ChatGPTEval().aeval_jsonl(in_filepath='user_oriented_instructions_deepl_ko.jsonl',
out_filepath='user_oriented_instructions_deepl_ko_eval_chatgpt.jsonl',
run_func=arun,
max_concurrency=100,
dev=False))
# GPT4 API를 사용하여 'user_oriented_instructions_deepl_ko.jsonl' 파일에 답변하고, 'user_oriented_instructions_deepl_ko_eval_gpt4.jsonl' 파일에 저장합니다.
asyncio.run(GPT4Eval().aeval_jsonl(in_filepath='user_oriented_instructions_deepl_ko.jsonl',
out_filepath='user_oriented_instructions_deepl_ko_eval_gpt4.jsonl',
run_func=arun,
max_concurrency=50,
dev=False))
# ChatGPT API를 사용하여 'user_oriented_instructions_chatgpt_ko.jsonl' 파일에 답변하고, 'user_oriented_instructions_chatgpt_ko_eval_chatgpt.jsonl' 파일에 저장합니다.
asyncio.run(ChatGPTEval().aeval_jsonl(in_filepath='user_oriented_instructions_chatgpt_ko.jsonl',
out_filepath='user_oriented_instructions_chatgpt_ko_eval_chatgpt.jsonl',
run_func=arun,
max_concurrency=100,
dev=False))
# GPT4 API를 사용하여 'user_oriented_instructions_chatgpt_ko.jsonl' 파일에 답변하고, 'user_oriented_instructions_chatgpt_ko_eval_gpt4.jsonl' 파일에 저장합니다.
asyncio.run(GPT4Eval().aeval_jsonl(in_filepath='user_oriented_instructions_chatgpt_ko.jsonl',
out_filepath='user_oriented_instructions_chatgpt_ko_eval_gpt4.jsonl',
run_func=arun,
max_concurrency=50,
dev=False))
# ChatGPT API를 사용하여 'user_oriented_instructions_gpt4_ko.jsonl' 파일에 답변하고, 'user_oriented_instructions_gpt4_ko_eval_chatgpt.jsonl' 파일에 저장합니다.
asyncio.run(ChatGPTEval().aeval_jsonl(in_filepath='user_oriented_instructions_gpt4_ko.jsonl',
out_filepath='user_oriented_instructions_gpt4_ko_eval_chatgpt.jsonl',
run_func=arun,
max_concurrency=100,
dev=False))
# GPT4 API를 사용하여 'user_oriented_instructions_gpt4_ko.jsonl' 파일에 답변하고, 'user_oriented_instructions_gpt4_ko_eval_gpt4.jsonl' 파일에 저장합니다.
asyncio.run(GPT4Eval().aeval_jsonl(in_filepath='user_oriented_instructions_gpt4_ko.jsonl',
out_filepath='user_oriented_instructions_gpt4_ko_eval_gpt4.jsonl',
run_func=arun,
max_concurrency=50,
dev=False))