Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ jobs:
- name: Check MiniWob availability
run: curl -I "http://localhost:8080/miniwob/" || echo "MiniWob not reachable"

- name: Pre-download nltk ressources
run: python -c "import nltk; nltk.download('punkt_tab')"

- name: Run AgentLab Unit Tests
env:
MINIWOB_URL: "http://localhost:8080/miniwob/"
Expand Down
10 changes: 8 additions & 2 deletions src/agentlab/experiments/args.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,13 +105,19 @@ def expand_cross_product(obj: Any | list[Any]):
for obj in obj_list:
cprod_paths = _find_cprod_with_paths(obj)
if not cprod_paths:
return [copy.deepcopy(obj)]
result.append(copy.deepcopy(obj))
continue

paths, cprod_objects = zip(*cprod_paths)
combinations = product(*[cprod_obj.elements for cprod_obj in cprod_objects])

# create a base object with empty fields to make fast deep copies from
base_obj = copy.deepcopy(obj)
for path in paths:
_set_value(base_obj, path, None)

for combo in combinations:
new_obj = copy.deepcopy(obj)
new_obj = copy.deepcopy(base_obj)
for path, value in zip(paths, combo):
_set_value(new_obj, path, value)
result.append(new_obj)
Expand Down