Repository navigation
Expand file tree
/
Copy pathmulti-evaluate_local_llm.py
More file actions
62 lines (54 loc) · 2.6 KB
/
Copy pathmulti-evaluate_local_llm.py
File metadata and controls
62 lines (54 loc) · 2.6 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
import subprocess
import os
def run_evaluation(cmd):
"""
Function to run the evaluation command.
"""
print(f"Running command: {cmd}")
my_env = os.environ.copy()
my_env["CUDA_VISIBLE_DEVICES"] = "1,2"
subprocess.run(cmd, env=my_env)
def main():
base_command = ["python3", "./Implementation/evaluate.py",
#"--LLM_model_name", "gemini-2.5-flash",
#"--LLM_model_name", "gpt-4o-mini-2024-07-18",
"--LLM_model_name", "--2--",
"--skip_dev",
"--rate_limit_timeout", "0",
"--local_llm",
"--batching",
"--max_output_tokens", "3000",
"--corpus", "--1--",
"--top_k", "10",
"--LLM_verbalization_strategy", "categories",
"--LLM_selection_strategy", "difference_abs",
"--threshold", "1.0",
"--iterations", "2",
"--candidate_ordering", "sorted",
"--spans_per_prompt", "5",
"--overview_save_path", "Results/Multi-Evaluate-Overview/finals_local_llm-overview.txt",
"--overview_run_name", "--x--"
]
parameter_change = {#"--1--": ["AIDA","tweeki", "reddit-comments", "shadowlinks-shadow", "shadowlinks-tail"],
#"--1--": ["msnbc", "ace2004", "aquaint"],
#"--1--": ["AIDA","cweb", "tweeki", "reddit-comments", "shadowlinks-shadow", "shadowlinks-tail", "shadowlinks-top", "reddit-posts", "wned-wiki"],
#"--1--": ["tweeki", "reddit-comments", "reddit-posts", "shadowlinks-shadow", "shadowlinks-tail"],
"--1--": ["AIDA"],
"--2--": ["deepseek-ai/DeepSeek-R1-Distill-Qwen-32B"]
#"--2--": ["gpt-4o-mini-2024-07-18"]
#"--2--": ["gemini-2.5-pro"]
}
run_repeat = 3 # Number of times to repeat each configuration
run_name = "finals_local_llm"
for param1 in parameter_change["--1--"]:
for param2 in parameter_change["--2--"]:
for i in range(run_repeat):
# Deep copy the base command
cmd = base_command.copy()
# Replace parameters
cmd[cmd.index("--1--")] = str(param1)
cmd[cmd.index("--2--")] = str(param2)
cmd[cmd.index("--x--")] = f"{param1}--{run_name}_{param2}--run{i+1}"
run_evaluation(cmd)
if __name__ == "__main__":
main()