"apps/kg/models/vscode:/vscode.git/clone" did not exist on "dca0e376e01965aab3369a46c7e8016082cf5d94"
Unverified Commit ccfa0841 authored by Ying Sheng's avatar Ying Sheng Committed by GitHub
Browse files

[script] update loogle test (#7975)

parent bcc5ba94
......@@ -73,6 +73,8 @@ async def benchmark(args):
tasks: List[asyncio.Task] = []
for idx, ex in enumerate(dataset):
if idx >= args.num_prompts:
break
tasks.append(
asyncio.create_task(
fetch_response(
......@@ -103,6 +105,8 @@ def analyse(args):
hyps: List[str] = []
refs: List[str] = []
for idx, ex in enumerate(tqdm(dataset, desc="Loading responses")):
if idx >= args.num_prompts:
break
pkl_file = output_dir / f"response_{idx}.pkl"
if not pkl_file.exists():
raise FileNotFoundError(pkl_file)
......@@ -150,6 +154,9 @@ if __name__ == "__main__":
parser.add_argument(
"--output-dir", default="tmp-output-dir", help="Directory for cached responses"
)
parser.add_argument(
"--num-prompts", type=int, default=10000, help="Number of prompts to run"
)
args = parser.parse_args()
asyncio.run(benchmark(args))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment