-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.py
More file actions
30 lines (26 loc) · 926 Bytes
/
run.py
File metadata and controls
30 lines (26 loc) · 926 Bytes
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
import os
import argparse
import yaml
from tqdm import tqdm
from src.utils.run_manager import RunManager
def get_args():
parser = argparse.ArgumentParser()
parser.add_argument("--config_file", type=str, default="configs/api_gpt4.yaml")
parser.add_argument("--output_path", type=str, default="output_groq_step1.jsonl")
args = parser.parse_args()
return args
if __name__ == "__main__":
args = get_args()
config_file = args.config_file
with open(config_file, 'r') as file:
config = yaml.safe_load(file)
run_manager = RunManager(config)
output_path = args.output_path
if os.path.exists(output_path):
os.remove(output_path)
idx = 0
for item in tqdm(run_manager.items):
print(idx, item.question)
run_time, total_item_num_input_tokens, total_item_num_output_tokens = run_manager._run_item(item,output_path=output_path)
idx += 1
pass