Skip to content
Open
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
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
install:
@echo "--- 🚀 Installing project dependencies ---"
pip install -e ./browsergym/core -e ./browsergym/miniwob -e ./browsergym/webarena -e ./browsergym/visualwebarena/ -e ./browsergym/experiments -e ./browsergym/assistantbench -e ./browsergym/
pip install -e ./browsergym/core -e ./browsergym/miniwob -e ./browsergym/webarena -e ./browsergym/visualwebarena/ -e ./browsergym/experiments -e ./browsergym/assistantbench
playwright install chromium

install-demo:
Expand Down
3 changes: 3 additions & 0 deletions browsergym/visualwebarena/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ dynamic = ["dependencies", "version"]
[project.urls]
homepage = "https://github.com/ServiceNow/BrowserGym"

[project.optional-dependencies]
torch = ["torch>=2.0.0"]

[tool.hatch.version]
path = "../core/src/browsergym/core/__init__.py"

Expand Down
1 change: 0 additions & 1 deletion browsergym/visualwebarena/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@ browsergym-core==0.14.2
browsergym-webarena
libvisualwebarena==0.0.15
requests
torch
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import nltk
import importlib.util

from browsergym.core.registration import register_task

Expand All @@ -11,6 +12,11 @@
except:
nltk.download("punkt_tab", quiet=True, raise_on_error=True)

if importlib.util.find_spec("torch") is None:
raise ImportError(
"The 'torch' package is required for VisualWebArena tasks evaluation. Please install it with 'pip install torch'."
)
Comment on lines +15 to +18
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Incomplete dependency error message category Documentation

Tell me more
What is the issue?

The error message states that torch is required but doesn't explain why it's needed for evaluation.

Why this matters

Users encountering this error won't understand which functionality depends on torch, making it harder to decide if they really need it.

Suggested change ∙ Feature Preview

if importlib.util.find_spec("torch") is None:
raise ImportError(
"The 'torch' package is required for VisualWebArena tasks evaluation (used for neural embedding comparisons). Please install it with 'pip install torch'."
)

Provide feedback to improve future suggestions

Nice Catch Incorrect Not in Scope Not in coding standard Other

💬 Looking for more details? Reply to this comment to chat with Korbit.


ALL_VISUALWEBARENA_TASK_IDS = []
VISUALWEBARENA_TASK_IDS_WITH_RESET = []
VISUALWEBARENA_TASK_IDS_WITHOUT_RESET = []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ def setup(self, page: playwright.sync_api.Page) -> tuple[str, dict]:
hide_progress_bar = is_progress_bar_enabled()
if hide_progress_bar:
disable_progress_bar()

captioning_fn = get_captioning_fn(
device=self.eval_captioning_model_device,
dtype=(
Expand Down
Loading