MCPcopy Create free account
hub / github.com/AMAP-ML/Thinking-with-Map / main

Function main

api_evaluation/api_gen.py:103–123  ·  view source on GitHub ↗
(parquet_files)

Source from the content-addressed store, hash-verified

101 return False
102
103def main(parquet_files):
104 df = load_parquet_files(parquet_files)
105 print(f"总记录数: {len(df)}")
106
107 done_indices = load_done_indices(OUTPUT_FILE)
108 print(f"已完成记录数: {len(done_indices)},将跳过这些 index")
109
110 # 过滤掉已完成的任务
111 tasks = []
112 for idx, row in df.iterrows():
113 if idx in done_indices:
114 continue
115 tasks.append((idx, row["prompt"], row["images"], row["data_source"], row["reward_model"]["ground_truth"]))
116
117 print(f"待处理记录数: {len(tasks)}")
118
119 # 用线程池并发执行
120 with ThreadPoolExecutor(max_workers=MAX_WORKERS) as executor:
121 futures = [executor.submit(query_openai_task, *task) for task in tasks]
122 for _ in tqdm(as_completed(futures), total=len(futures), desc="Processing"):
123 pass # 这里进度条只显示完成进度
124
125if __name__ == "__main__":
126 parquet_files = [

Callers 1

api_gen.pyFile · 0.70

Calls 2

load_parquet_filesFunction · 0.70
load_done_indicesFunction · 0.70

Tested by

no test coverage detected