Skip to content

Commit 6e72045

Browse files
recursixgasse
authored andcommitted
yet another way to kill timedout jobs (#108)
1 parent 0a3f71e commit 6e72045

File tree

3 files changed

+16
-6
lines changed

3 files changed

+16
-6
lines changed

src/agentlab/agents/dynamic_prompting.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,12 @@
1010

1111
import bgym
1212
from browsergym.core.action.base import AbstractActionSet
13-
from browsergym.utils.obs import flatten_axtree_to_str, flatten_dom_to_str, overlay_som, prune_html
13+
from browsergym.utils.obs import (
14+
flatten_axtree_to_str,
15+
flatten_dom_to_str,
16+
overlay_som,
17+
prune_html,
18+
)
1419

1520
from agentlab.llm.llm_utils import (
1621
BaseMessage,

src/agentlab/experiments/graph_execution_ray.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@
22

33
# # Disable Ray log deduplication
44
# os.environ["RAY_DEDUP_LOGS"] = "0"
5+
import logging
56
import time
6-
import ray
7+
78
import bgym
8-
from agentlab.experiments.exp_utils import run_exp, _episode_timeout
9+
import ray
910
from ray.util import state
10-
import logging
11+
12+
from agentlab.experiments.exp_utils import _episode_timeout, run_exp
1113

1214
logger = logging.getLogger(__name__)
1315

@@ -36,7 +38,7 @@ def get_task(exp_arg: bgym.ExpArgs):
3638
get_task(exp_arg)
3739

3840
max_timeout = max([_episode_timeout(exp_args, avg_step_timeout) for exp_args in exp_args_list])
39-
41+
4042
return poll_for_timeout(task_map, max_timeout, poll_interval=max_timeout * 0.1)
4143

4244

tests/agents/test_generic_prompt.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@
55

66
from agentlab.agents import dynamic_prompting as dp
77
from agentlab.agents.generic_agent.agent_configs import FLAGS_GPT_3_5
8-
from agentlab.agents.generic_agent.generic_agent_prompt import GenericPromptFlags, MainPrompt
8+
from agentlab.agents.generic_agent.generic_agent_prompt import (
9+
GenericPromptFlags,
10+
MainPrompt,
11+
)
912
from agentlab.llm.llm_utils import count_tokens
1013

1114
html_template = """

0 commit comments

Comments
 (0)