Skip to content

Commit

Permalink
probably fix the event loop closed error: following NVIDIA/NeMo-Guard…
Browse files Browse the repository at this point in the history
  • Loading branch information
ProKil committed May 27, 2024
1 parent e8a59d2 commit 9e15790
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions sotopia/benchmark/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ def run_async_benchmark_in_batch(
)
env_agent_combo_batch: list[EnvAgentCombo[Observation, AgentAction]] = []
number_of_fix_turns = 0
loop = asyncio.get_event_loop()
while True:
for env_agent_combo in tqdm(
env_agent_combo_iter,
Expand All @@ -173,7 +174,7 @@ def run_async_benchmark_in_batch(
logging.info(
f"Running batch of {batch_size} episodes: {env_agent_combo_batch}"
)
asyncio.run(
loop.run_until_complete(
run_async_server(
model_dict=model_names,
sampler=BaseSampler[Observation, AgentAction](),
Expand All @@ -188,7 +189,7 @@ def run_async_benchmark_in_batch(
logging.info(
f"Running batch of {batch_size} episodes: {env_agent_combo_batch}"
)
asyncio.run(
loop.run_until_complete(
run_async_server(
model_dict=model_names,
sampler=BaseSampler[Observation, AgentAction](),
Expand Down

0 comments on commit 9e15790

Please sign in to comment.