-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathsdk_local.py
64 lines (54 loc) · 1.74 KB
/
sdk_local.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
from dingo.exec import Executor
from dingo.io import InputArgs
def local_plaintext():
input_data = {
"eval_group": "sft",
"input_path": "../../test/data/test_local_plaintext.txt", # local filesystem dataset
"dataset": "local",
"data_format": "plaintext",
}
input_args = InputArgs(**input_data)
executor = Executor.exec_map["local"](input_args)
result = executor.execute()
print(result)
def local_json():
input_data = {
"eval_group": "sft",
"input_path": "../../test/data/test_local_json.json", # local filesystem dataset
"dataset": "local",
"data_format": "json",
"column_content": "prediction",
}
input_args = InputArgs(**input_data)
executor = Executor.exec_map["local"](input_args)
result = executor.execute()
print(result)
def local_jsonl():
input_data = {
"eval_group": "sft",
"input_path": "../../test/data/test_local_jsonl.jsonl", # local filesystem dataset
"dataset": "local",
"data_format": "jsonl",
"column_content": "content",
}
input_args = InputArgs(**input_data)
executor = Executor.exec_map["local"](input_args)
result = executor.execute()
print(result)
def local_listjson():
input_data = {
"eval_group": "sft",
"input_path": "../../test/data/test_local_listjson.json", # local filesystem dataset
"dataset": "local",
"data_format": "listjson",
"column_content": "output",
}
input_args = InputArgs(**input_data)
executor = Executor.exec_map["local"](input_args)
result = executor.execute()
print(result)
if __name__ == '__main__':
local_plaintext()
local_json()
local_jsonl()
local_listjson()