Skip to content

Commit ad766bf

Browse files
committed
Add filtering when search
1 parent c774672 commit ad766bf

File tree

3 files changed

+121
-1
lines changed

3 files changed

+121
-1
lines changed

resources/qwen-72b.yml

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
- openai_url: https://api.qdrant.mil-team.ru/chat-1/v1/
2+
model_name: Compressa-Qwen2-72B-Instruct
3+
experiment_name: "Qwen2-72B Long Input / Short Output"
4+
description: "Experiment using prompts from a file with 20 tasks and 10 runners"
5+
prompts_file: resources/prompts.csv
6+
generate_prompts: true
7+
num_prompts: 100000
8+
prompt_length: 12000
9+
num_tasks: 50
10+
num_runners: 1
11+
max_tokens: 100
12+
13+
- openai_url: https://api.qdrant.mil-team.ru/chat-1/v1/
14+
model_name: Compressa-Qwen2-72B-Instruct
15+
experiment_name: "Qwen2-72B Long Input / Short Output"
16+
description: "Experiment using prompts from a file with 20 tasks and 10 runners"
17+
prompts_file: resources/prompts.csv
18+
generate_prompts: true
19+
num_prompts: 100000
20+
prompt_length: 12000
21+
num_tasks: 50
22+
num_runners: 5
23+
max_tokens: 100
24+
25+
- openai_url: https://api.qdrant.mil-team.ru/chat-1/v1/
26+
model_name: Compressa-Qwen2-72B-Instruct
27+
experiment_name: "Qwen2-72B Long Input / Short Output"
28+
description: "Experiment using prompts from a file with 20 tasks and 10 runners"
29+
prompts_file: resources/prompts.csv
30+
generate_prompts: true
31+
num_prompts: 100000
32+
prompt_length: 12000
33+
num_tasks: 50
34+
num_runners: 10
35+
max_tokens: 100
36+
37+
- openai_url: https://api.qdrant.mil-team.ru/chat-1/v1/
38+
model_name: Compressa-Qwen2-72B-Instruct
39+
experiment_name: "Qwen2-72B Long Input / Short Output"
40+
description: "Experiment using prompts from a file with 20 tasks and 10 runners"
41+
prompts_file: resources/prompts.csv
42+
generate_prompts: true
43+
num_prompts: 100000
44+
prompt_length: 12000
45+
num_tasks: 50
46+
num_runners: 20
47+
max_tokens: 100
48+
49+
50+
- openai_url: https://api.qdrant.mil-team.ru/chat-1/v1/
51+
model_name: Compressa-Qwen2-72B-Instruct
52+
experiment_name: "Qwen2-72B Long Input / Short Output"
53+
description: "Experiment using prompts from a file with 20 tasks and 10 runners"
54+
prompts_file: resources/prompts.csv
55+
generate_prompts: true
56+
num_prompts: 100000
57+
prompt_length: 12000
58+
num_tasks: 50
59+
num_runners: 1
60+
max_tokens: 2000
61+
62+
- openai_url: https://api.qdrant.mil-team.ru/chat-1/v1/
63+
model_name: Compressa-Qwen2-72B-Instruct
64+
experiment_name: "Qwen2-72B Long Input / Short Output"
65+
description: "Experiment using prompts from a file with 20 tasks and 10 runners"
66+
prompts_file: resources/prompts.csv
67+
generate_prompts: true
68+
num_prompts: 100000
69+
prompt_length: 12000
70+
num_tasks: 50
71+
num_runners: 5
72+
max_tokens: 2000
73+
74+
- openai_url: https://api.qdrant.mil-team.ru/chat-1/v1/
75+
model_name: Compressa-Qwen2-72B-Instruct
76+
experiment_name: "Qwen2-72B Long Input / Short Output"
77+
description: "Experiment using prompts from a file with 20 tasks and 10 runners"
78+
prompts_file: resources/prompts.csv
79+
generate_prompts: true
80+
num_prompts: 100000
81+
prompt_length: 12000
82+
num_tasks: 50
83+
num_runners: 10
84+
max_tokens: 2000
85+
86+
- openai_url: https://api.qdrant.mil-team.ru/chat-1/v1/
87+
model_name: Compressa-Qwen2-72B-Instruct
88+
experiment_name: "Qwen2-72B Long Input / Short Output"
89+
description: "Experiment using prompts from a file with 20 tasks and 10 runners"
90+
prompts_file: resources/prompts.csv
91+
generate_prompts: true
92+
num_prompts: 100000
93+
prompt_length: 12000
94+
num_tasks: 50
95+
num_runners: 20
96+
max_tokens: 2000

src/compressa/perf/cli/__main__.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@ def list_experiments_args(args):
3838
list_experiments(
3939
db=args.db,
4040
show_parameters=args.show_parameters,
41-
show_metrics=args.show_metrics
41+
show_metrics=args.show_metrics,
42+
name_filter=args.name_filter,
43+
param_filter=args.param_filter,
4244
)
4345

4446

@@ -182,6 +184,16 @@ def main():
182184
action="store_true",
183185
help="Show metrics for each experiment"
184186
)
187+
parser_list.add_argument(
188+
"--name-filter",
189+
type=str,
190+
help="Filter experiments by substring in the name"
191+
)
192+
parser_list.add_argument(
193+
"--param-filter",
194+
type=str,
195+
help="Filter experiments by parameter value (e.g., paramkey=value_substring)"
196+
)
185197
parser_list.set_defaults(func=list_experiments_args)
186198

187199
parser_yaml = subparsers.add_parser(

src/compressa/perf/cli/tools.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,12 +179,24 @@ def list_experiments(
179179
db: str = DEFAULT_DB_PATH,
180180
show_parameters: bool = False,
181181
show_metrics: bool = False,
182+
name_filter: str = None,
183+
param_filter: str = None,
182184
):
183185
with sqlite3.connect(db) as conn:
184186
ensure_db_initialized(conn)
185187

186188
experiments = fetch_all_experiments(conn)
187189

190+
if name_filter:
191+
experiments = [exp for exp in experiments if name_filter in exp.experiment_name]
192+
193+
if param_filter:
194+
param_key, _, param_value_substring = param_filter.partition('=')
195+
experiments = [exp for exp in experiments if any(
196+
p.key == param_key and param_value_substring in format_value(p.value)
197+
for p in fetch_parameters_by_experiment(conn, exp.id)
198+
)]
199+
188200
if not experiments:
189201
print("No experiments found in the database.")
190202
return

0 commit comments

Comments
 (0)