forked from MigoXLab/dingo
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsdk_mtbench_llm.py
More file actions
45 lines (42 loc) · 1.18 KB
/
sdk_mtbench_llm.py
File metadata and controls
45 lines (42 loc) · 1.18 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
import os
from dingo.config import InputArgs
from dingo.exec import Executor
if __name__ == '__main__':
OPENAI_MODEL = 'deepseek-chat'
OPENAI_URL = 'https://api.deepseek.com/v1'
OPENAI_KEY = os.getenv("OPENAI_KEY")
common_config = {
"model": OPENAI_MODEL,
"key": OPENAI_KEY,
"api_url": OPENAI_URL,
}
input_data = {
"input_path": "lmsys/mt_bench_human_judgments",
"dataset": {
"source": "hugging_face",
"format": "multi_turn_dialog",
"hf_config": {
"huggingface_split": "human"
}
},
"executor": {
"result_save": {
"bad": True,
"good": True
},
"end_index": 5,
"multi_turn_mode": "all"
},
"evaluator": [
{
"fields": {"content": "conversation_a"},
"evals": [
{"name": "LLMTextQualityV3", "config": common_config}
],
}
]
}
input_args = InputArgs(**input_data)
executor = Executor.exec_map["local"](input_args)
result = executor.execute()
print(result)