-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgenerate_triframe_manifest.py
More file actions
149 lines (136 loc) · 5.21 KB
/
Copy pathgenerate_triframe_manifest.py
File metadata and controls
149 lines (136 loc) · 5.21 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
import json
# Model configurations
MODELS = [
("gpt-4o-mini", "4om"),
("gpt-4o", "4o"),
("o1", "o1"),
("claude-3-5-sonnet-20241022", "c3.6s"),
("fireworks/deepseek-v3", "ds3"),
]
AIRD = [True, False]
def generate_manifest() -> None:
"""Generate the manifest file with settings packs"""
MANIFEST = {
"settingsSchema": {
"type": "object",
"properties": {
"advisors": {
"type": "array",
"items": {
"type": "object",
"properties": {
"model": {"type": "string"},
"temp": {"type": "number"},
"n": {"type": "integer"},
},
},
},
"actors": {
"type": "array",
"items": {
"type": "object",
"properties": {
"model": {"type": "string"},
"temp": {"type": "number"},
"n": {"type": "integer"},
},
},
},
"raters": {
"type": "array",
"items": {
"type": "object",
"properties": {
"model": {"type": "string"},
"temp": {"type": "number"},
"n": {"type": "integer"},
},
},
},
"limit_type": {"type": "string"},
"intermediate_scoring": {"type": "boolean"},
"require_function_call": {"type": "boolean"},
"enable_advising": {"type": "boolean"},
},
"required": ["advisors", "actors", "raters"],
},
"stateSchema": {
"type": "object",
"properties": {
"task_string": {"type": "string"},
"nodes": {
"type": "array",
"items": {
"type": "object",
"properties": {
"source": {"type": "string"},
"options": {
"type": "array",
"items": {
"type": "object",
"properties": {
"content": {"type": "string"},
"function_call": {
"type": ["object", "null"],
"default": None,
},
},
"required": ["content"],
},
},
"token_usage": {"type": "integer"},
"actions_usage": {"type": "integer"},
"time_usage": {"type": "integer"},
},
"required": ["source", "options"],
},
},
},
"required": ["task_string", "nodes"],
},
"settingsPacks": {},
}
settings_packs = {}
# Create homogeneous model settings
for model, model_short in MODELS:
for aird in AIRD:
pack_name = f"triframe_{model_short}_all{'_aird' if aird else ''}"
settings_packs[pack_name] = {
"advisors": [{"model": model, "temp": 1.0, "n": 1}],
"actors": [{"model": model, "temp": 1.0, "n": 3}],
"raters": [{"model": model, "temp": 1.0, "n": 2}],
"limit_type": "time" if aird else "token",
"intermediate_scoring": aird,
"require_function_call": False,
"enable_advising": True,
}
# Create mixed model setting with 4o actor and o1 others
settings_packs["triframe_4o_o1"] = {
"advisors": [{"model": "o1", "temp": 1.0, "n": 1}],
"actors": [
{"model": "gpt-4o", "temp": 1.0, "n": 4},
{"model": "o1", "temp": 1.0, "n": 4},
],
"raters": [
{"model": "gpt-4o", "temp": 1.0, "n": 2},
{"model": "o1", "temp": 1.0, "n": 2},
],
"limit_type": "token",
"intermediate_scoring": False,
"require_function_call": False,
"enable_advising": True,
}
# Add no-advisor variants for each pack
no_advisor_packs = {}
for pack_name, pack in settings_packs.items():
no_advisor_pack = pack.copy()
no_advisor_pack["enable_advising"] = False
no_advisor_packs[f"{pack_name}_no_advisor"] = no_advisor_pack
# Merge all packs
settings_packs.update(no_advisor_packs)
MANIFEST["settingsPacks"] = settings_packs
MANIFEST["defaultSettingsPack"] = "triframe_4om_all"
with open("manifest.json", "w") as f:
json.dump(MANIFEST, f, indent=4, sort_keys=True)
if __name__ == "__main__":
generate_manifest()