File tree Expand file tree Collapse file tree 2 files changed +23
-2
lines changed
src/envs/browsergym_env/server Expand file tree Collapse file tree 2 files changed +23
-2
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,8 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
2222 libcairo2 \
2323 libasound2 \
2424 libxshmfence1 \
25+ fonts-unifont \
26+ fonts-noto-color-emoji \
2527 # Additional dependencies
2628 git \
2729 wget \
@@ -33,8 +35,7 @@ RUN pip install --no-cache-dir -r /tmp/browsergym_requirements.txt && \
3335 rm /tmp/browsergym_requirements.txt
3436
3537# Install Playwright browsers (Chromium by default)
36- RUN playwright install chromium && \
37- playwright install-deps chromium
38+ RUN playwright install chromium
3839
3940# Copy OpenEnv core and browsergym_env code
4041WORKDIR /app
Original file line number Diff line number Diff line change 88- WorkArena: Enterprise task automation
99"""
1010
11+ import importlib
1112from typing import Any , Dict , Optional
1213from uuid import uuid4
1314
@@ -66,6 +67,25 @@ def __init__(
6667 else :
6768 self .env_id = f"browsergym/{ benchmark } "
6869
70+ # force import the benchmark module
71+ benchmark_modules = {
72+ "miniwob" : "browsergym.envs.miniwob" ,
73+ "webarena" : "browsergym.envs.webarena" ,
74+ "visualwebarena" : "browsergym.envs.visualwebarena" ,
75+ "workarena" : "browsergym.envs.workarena" ,
76+ }
77+ module_path = benchmark_modules .get (benchmark )
78+ try :
79+ if module_path :
80+ importlib .import_module (module_path )
81+ else :
82+ importlib .import_module ("browsergym" )
83+ except ModuleNotFoundError as import_error :
84+ raise ValueError (
85+ f"Failed to import BrowserGym benchmark '{ benchmark } ': { import_error } \n "
86+ f"Make sure the package browsergym-{ benchmark } is installed."
87+ ) from import_error
88+
6989 # Create the BrowserGym environment
7090 try :
7191 self .gym_env = gym .make (
You can’t perform that action at this time.
0 commit comments