Git Product home page Git Product logo

Comments (8)

zhc7 avatar zhc7 commented on July 19, 2024

Hi, I guess you wish to set up the environment by yourself. Based on the error message you provided, I think you should check "../search_engine/{indexes}" directory. There should be some folders starting with indexes_. Maybe you've missed some steps. If you executed setup.sh, make sure you used -d all. And maybe you should check if there were any error messages omitted when you executed setup.sh.

By the way, we recommend you to use our prebuilt docker images.

from agentbench.

harshraj172 avatar harshraj172 commented on July 19, 2024

Thanks for this, I got the issue. It seems easier to do with the docker container.
Thanks You

from agentbench.

Z-ZHHH avatar Z-ZHHH commented on July 19, 2024

Faced the below error when I ran the webshop task. It seems the code is running in the docker, can anyone pls help?

jnius.JavaException: JVM exception occurred: /root/workspace/src/tasks/webshop/web_agent_site/../search_engine/indexes does not exist or is not a directory. java.lang.IllegalArgumentException

Here is the full one:

(agentbench) GP-TRT-2:~/AgentBench$ bash .assignments/2023-09-14-10-16-52.sh
Evaluating in docker localhost/task:webshop, Parameters: --task outputs/2023-09-14-10-16-52/llama2-7b/WebShop-dev/task.yaml --agent outputs/2023-09-14-10-16-52/llama2-7b/WebShop-dev/agent.yaml --output outputs/2023-09-14-10-16-52/llama2-7b/WebShop-dev
> [Warning] FastChat agent not available
{'module': 'src.tasks.WebShop', 'parameters': {'end': 280, 'name': 'WebShop-dev', 'num_envs': 3, 'start': 200, 'worker_limit': 3, 'workers': 6}}
{'module': 'src.agents.HTTPAgent', 'parameters': {'body': {'Key1': 'Value1', 'Key2': 'Value2'}, 'headers': {'Content-Type': 'application/json'}, 'name': 'llama2-7b', 'prompter': {'args': {'agent_role': 'assistant'}, 'name': 'role_content_dict'}, 'url': 'http://localhost:8000/v1/chat/completions'}}
[Evaluation] Loading Agent ...
[Evaluation] Successfully loaded Agent.
[Evaluation] Loading Task ...
> [Warning] OSInteraction task not available
> [Warning] ALFWorld task not available
> [Warning] DBBench task not available
Warning: Gym version v0.24.0 has a number of critical issues with `gym.make` such that the `reset` and `step` functions are called before returning the environment. It is recommend to downgrading to v0.23.1 or upgrading to v0.25.1
/root/miniconda3/envs/webshop/lib/python3.8/site-packages/pkg_resources/__init__.py:121: DeprecationWarning: pkg_resources is deprecated as an API
  warnings.warn("pkg_resources is deprecated as an API", DeprecationWarning)
/root/miniconda3/envs/webshop/lib/python3.8/site-packages/pkg_resources/__init__.py:2870: DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('mpl_toolkits')`.
Implementing implicit namespace packages (as specified in PEP 420) is preferred to `pkg_resources.declare_namespace`. See https://setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packages
  declare_namespace(pkg)
/root/miniconda3/envs/webshop/lib/python3.8/site-packages/faiss/loader.py:28: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
  if LooseVersion(numpy.__version__) >= "1.19":
/root/miniconda3/envs/webshop/lib/python3.8/site-packages/setuptools/_distutils/version.py:345: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
  other = LooseVersion(other)
/root/miniconda3/envs/webshop/lib/python3.8/site-packages/thefuzz/fuzz.py:11: UserWarning: Using slow pure-python SequenceMatcher. Install python-Levenshtein to remove this warning
  warnings.warn('Using slow pure-python SequenceMatcher. Install python-Levenshtein to remove this warning')
/root/miniconda3/envs/webshop/lib/python3.8/site-packages/gym/envs/registration.py:516: UserWarning: WARN: Overriding environment WebAgentSiteEnv-v0
  logger.warn(f"Overriding environment {spec.id}")
/root/miniconda3/envs/webshop/lib/python3.8/site-packages/gym/envs/registration.py:516: UserWarning: WARN: Overriding environment WebAgentTextEnv-v0
  logger.warn(f"Overriding environment {spec.id}")
> [Warning] Mind2Web task not available
> [Warning] KnowledgeGraph task not available
[Evaluation] Successfully loaded Task.
Evaluating task 'WebShop-dev' ...
Start Predicting All ...
  0%|                                                                                                                   | 0/80 [00:00<?, ?it/s]> [Warning] FastChat agent not available
> [Warning] OSInteraction task not available
> [Warning] FastChat agent not available
> [Warning] ALFWorld task not available
> [Warning] DBBench task not available
> [Warning] FastChat agent not available
> [Warning] OSInteraction task not available
> [Warning] ALFWorld task not available
> [Warning] DBBench task not available
Warning: Gym version v0.24.0 has a number of critical issues with `gym.make` such that the `reset` and `step` functions are called before returning the environment. It is recommend to downgrading to v0.23.1 or upgrading to v0.25.1
> [Warning] OSInteraction task not available
> [Warning] ALFWorld task not available
> [Warning] DBBench task not available
Warning: Gym version v0.24.0 has a number of critical issues with `gym.make` such that the `reset` and `step` functions are called before returning the environment. It is recommend to downgrading to v0.23.1 or upgrading to v0.25.1
Warning: Gym version v0.24.0 has a number of critical issues with `gym.make` such that the `reset` and `step` functions are called before returning the environment. It is recommend to downgrading to v0.23.1 or upgrading to v0.25.1
/root/miniconda3/envs/webshop/lib/python3.8/site-packages/pkg_resources/__init__.py:121: DeprecationWarning: pkg_resources is deprecated as an API
  warnings.warn("pkg_resources is deprecated as an API", DeprecationWarning)
/root/miniconda3/envs/webshop/lib/python3.8/site-packages/pkg_resources/__init__.py:2870: DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('mpl_toolkits')`.
Implementing implicit namespace packages (as specified in PEP 420) is preferred to `pkg_resources.declare_namespace`. See https://setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packages
  declare_namespace(pkg)
/root/miniconda3/envs/webshop/lib/python3.8/site-packages/pkg_resources/__init__.py:121: DeprecationWarning: pkg_resources is deprecated as an API
  warnings.warn("pkg_resources is deprecated as an API", DeprecationWarning)
/root/miniconda3/envs/webshop/lib/python3.8/site-packages/pkg_resources/__init__.py:2870: DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('mpl_toolkits')`.
Implementing implicit namespace packages (as specified in PEP 420) is preferred to `pkg_resources.declare_namespace`. See https://setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packages
  declare_namespace(pkg)
/root/miniconda3/envs/webshop/lib/python3.8/site-packages/pkg_resources/__init__.py:121: DeprecationWarning: pkg_resources is deprecated as an API
  warnings.warn("pkg_resources is deprecated as an API", DeprecationWarning)
/root/miniconda3/envs/webshop/lib/python3.8/site-packages/pkg_resources/__init__.py:2870: DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('mpl_toolkits')`.
Implementing implicit namespace packages (as specified in PEP 420) is preferred to `pkg_resources.declare_namespace`. See https://setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packages
  declare_namespace(pkg)
/root/miniconda3/envs/webshop/lib/python3.8/site-packages/faiss/loader.py:28: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
  if LooseVersion(numpy.__version__) >= "1.19":
/root/miniconda3/envs/webshop/lib/python3.8/site-packages/setuptools/_distutils/version.py:345: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
  other = LooseVersion(other)
/root/miniconda3/envs/webshop/lib/python3.8/site-packages/faiss/loader.py:28: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
  if LooseVersion(numpy.__version__) >= "1.19":
/root/miniconda3/envs/webshop/lib/python3.8/site-packages/setuptools/_distutils/version.py:345: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
  other = LooseVersion(other)
/root/miniconda3/envs/webshop/lib/python3.8/site-packages/faiss/loader.py:28: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
  if LooseVersion(numpy.__version__) >= "1.19":
/root/miniconda3/envs/webshop/lib/python3.8/site-packages/setuptools/_distutils/version.py:345: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
  other = LooseVersion(other)
/root/miniconda3/envs/webshop/lib/python3.8/site-packages/thefuzz/fuzz.py:11: UserWarning: Using slow pure-python SequenceMatcher. Install python-Levenshtein to remove this warning
  warnings.warn('Using slow pure-python SequenceMatcher. Install python-Levenshtein to remove this warning')
/root/miniconda3/envs/webshop/lib/python3.8/site-packages/thefuzz/fuzz.py:11: UserWarning: Using slow pure-python SequenceMatcher. Install python-Levenshtein to remove this warning
  warnings.warn('Using slow pure-python SequenceMatcher. Install python-Levenshtein to remove this warning')
/root/miniconda3/envs/webshop/lib/python3.8/site-packages/thefuzz/fuzz.py:11: UserWarning: Using slow pure-python SequenceMatcher. Install python-Levenshtein to remove this warning
  warnings.warn('Using slow pure-python SequenceMatcher. Install python-Levenshtein to remove this warning')
/root/miniconda3/envs/webshop/lib/python3.8/site-packages/gym/envs/registration.py:516: UserWarning: WARN: Overriding environment WebAgentSiteEnv-v0
  logger.warn(f"Overriding environment {spec.id}")
/root/miniconda3/envs/webshop/lib/python3.8/site-packages/gym/envs/registration.py:516: UserWarning: WARN: Overriding environment WebAgentTextEnv-v0
  logger.warn(f"Overriding environment {spec.id}")
> [Warning] Mind2Web task not available
> [Warning] KnowledgeGraph task not available
Products loaded.
Keys cleaned.
/root/miniconda3/envs/webshop/lib/python3.8/site-packages/gym/envs/registration.py:516: UserWarning: WARN: Overriding environment WebAgentSiteEnv-v0
  logger.warn(f"Overriding environment {spec.id}")
/root/miniconda3/envs/webshop/lib/python3.8/site-packages/gym/envs/registration.py:516: UserWarning: WARN: Overriding environment WebAgentTextEnv-v0
  logger.warn(f"Overriding environment {spec.id}")
> [Warning] Mind2Web task not available
> [Warning] KnowledgeGraph task not available
Products loaded.
Keys cleaned.
Attributes loaded.
100%|███████████████████████████████████████████████████████████████████████████████████████████████████| 1000/1000 [00:00<00:00, 70730.25it/s]
Process SpawnProcess-1:
Traceback (most recent call last):
  File "/root/miniconda3/envs/webshop/lib/python3.8/site-packages/multiprocess/process.py", line 315, in _bootstrap
    self.run()
  File "/root/miniconda3/envs/webshop/lib/python3.8/site-packages/multiprocess/process.py", line 108, in run
    self._target(*self._args, **self._kwargs)
  File "/root/workspace/src/tasks/webshop_docker/__init__.py", line 38, in predict
    env = WebAgentTextEnv(observation_mode="text", human_goals=True)
  File "/root/workspace/src/tasks/webshop_docker/web_agent_site/envs/web_agent_text_env.py", line 61, in __init__
    self.server = SimServer(
  File "/root/workspace/src/tasks/webshop_docker/web_agent_site/envs/web_agent_text_env.py", line 299, in __init__
    self.search_engine = init_search_engine(num_products=num_products)
  File "/root/workspace/src/tasks/webshop/web_agent_site/engine/engine.py", line 206, in init_search_engine
    search_engine = LuceneSearcher(os.path.join(BASE_DIR, f'../search_engine/{indexes}'))
  File "/root/miniconda3/envs/webshop/lib/python3.8/site-packages/pyserini/search/lucene/_searcher.py", line 51, in __init__
    self.object = JLuceneSearcher(index_dir)
  File "jnius/jnius_export_class.pxi", line 270, in jnius.JavaClass.__init__
  File "jnius/jnius_export_class.pxi", line 384, in jnius.JavaClass.call_constructor
  File "jnius/jnius_utils.pxi", line 79, in jnius.check_exception
jnius.JavaException: JVM exception occurred: /root/workspace/src/tasks/webshop/web_agent_site/../search_engine/indexes does not exist or is not a directory. java.lang.IllegalArgumentException
Attributes loaded.
100%|███████████████████████████████████████████████████████████████████████████████████████████████████| 1000/1000 [00:00<00:00, 68716.28it/s]
Process SpawnProcess-2:
Traceback (most recent call last):
  File "/root/miniconda3/envs/webshop/lib/python3.8/site-packages/multiprocess/process.py", line 315, in _bootstrap
    self.run()
  File "/root/miniconda3/envs/webshop/lib/python3.8/site-packages/multiprocess/process.py", line 108, in run
    self._target(*self._args, **self._kwargs)
  File "/root/workspace/src/tasks/webshop_docker/__init__.py", line 38, in predict
    env = WebAgentTextEnv(observation_mode="text", human_goals=True)
  File "/root/workspace/src/tasks/webshop_docker/web_agent_site/envs/web_agent_text_env.py", line 61, in __init__
    self.server = SimServer(
  File "/root/workspace/src/tasks/webshop_docker/web_agent_site/envs/web_agent_text_env.py", line 299, in __init__
    self.search_engine = init_search_engine(num_products=num_products)
  File "/root/workspace/src/tasks/webshop/web_agent_site/engine/engine.py", line 206, in init_search_engine
    search_engine = LuceneSearcher(os.path.join(BASE_DIR, f'../search_engine/{indexes}'))
  File "/root/miniconda3/envs/webshop/lib/python3.8/site-packages/pyserini/search/lucene/_searcher.py", line 51, in __init__
    self.object = JLuceneSearcher(index_dir)
  File "jnius/jnius_export_class.pxi", line 270, in jnius.JavaClass.__init__
  File "jnius/jnius_export_class.pxi", line 384, in jnius.JavaClass.call_constructor
  File "jnius/jnius_utils.pxi", line 79, in jnius.check_exception
jnius.JavaException: JVM exception occurred: /root/workspace/src/tasks/webshop/web_agent_site/../search_engine/indexes does not exist or is not a directory. java.lang.IllegalArgumentException
/root/miniconda3/envs/webshop/lib/python3.8/site-packages/gym/envs/registration.py:516: UserWarning: WARN: Overriding environment WebAgentSiteEnv-v0
  logger.warn(f"Overriding environment {spec.id}")
/root/miniconda3/envs/webshop/lib/python3.8/site-packages/gym/envs/registration.py:516: UserWarning: WARN: Overriding environment WebAgentTextEnv-v0
  logger.warn(f"Overriding environment {spec.id}")
> [Warning] Mind2Web task not available
> [Warning] KnowledgeGraph task not available
Products loaded.
Keys cleaned.
Attributes loaded.
100%|███████████████████████████████████████████████████████████████████████████████████████████████████| 1000/1000 [00:00<00:00, 72446.74it/s]
Process SpawnProcess-3:
Traceback (most recent call last):
  File "/root/miniconda3/envs/webshop/lib/python3.8/site-packages/multiprocess/process.py", line 315, in _bootstrap
    self.run()
  File "/root/miniconda3/envs/webshop/lib/python3.8/site-packages/multiprocess/process.py", line 108, in run
    self._target(*self._args, **self._kwargs)
  File "/root/workspace/src/tasks/webshop_docker/__init__.py", line 38, in predict
    env = WebAgentTextEnv(observation_mode="text", human_goals=True)
  File "/root/workspace/src/tasks/webshop_docker/web_agent_site/envs/web_agent_text_env.py", line 61, in __init__
    self.server = SimServer(
  File "/root/workspace/src/tasks/webshop_docker/web_agent_site/envs/web_agent_text_env.py", line 299, in __init__
    self.search_engine = init_search_engine(num_products=num_products)
  File "/root/workspace/src/tasks/webshop/web_agent_site/engine/engine.py", line 206, in init_search_engine
    search_engine = LuceneSearcher(os.path.join(BASE_DIR, f'../search_engine/{indexes}'))
  File "/root/miniconda3/envs/webshop/lib/python3.8/site-packages/pyserini/search/lucene/_searcher.py", line 51, in __init__
    self.object = JLuceneSearcher(index_dir)
  File "jnius/jnius_export_class.pxi", line 270, in jnius.JavaClass.__init__
  File "jnius/jnius_export_class.pxi", line 384, in jnius.JavaClass.call_constructor
  File "jnius/jnius_utils.pxi", line 79, in jnius.check_exception
jnius.JavaException: JVM exception occurred: /root/workspace/src/tasks/webshop/web_agent_site/../search_engine/indexes does not exist or is not a directory. java.lang.IllegalArgumentException

from agentbench.

zhc7 avatar zhc7 commented on July 19, 2024

Are you sure you've pulled the docker image? Based on the output, it seems that you are not using code in docker. The label of progress bar should be about 1 million instead of 1k.

from agentbench.

Z-ZHHH avatar Z-ZHHH commented on July 19, 2024

I have run

bash scripts/build_docker.sh
CONTAINER ID   IMAGE                    COMMAND                   CREATED         STATUS         PORTS     NAMES
e8fbc10eadab   localhost/task:webshop   "bash -c '\n         …"   5 seconds ago   Up 5 seconds             interesting_dhawan

It seems that I've pulled the docker image. And there are files in the docker image:

LICENSE.md   assets           data              run_envs                   run_web_agent_text_env.sh  tests              web_agent_site
README.md    baseline_models  requirements.txt  run_prod.sh                search_engine              transfer
__pycache__  conftest.py      run_dev.sh        run_web_agent_site_env.sh  setup.sh                   user_session_logs

from agentbench.

zhc7 avatar zhc7 commented on July 19, 2024

Based on what you provided in #42
Actually /root/webshop is soft linked to /root/workspace/src/tasks/webshop_docker to avoid overwriting files.

There are two strange things in the output:

  1. Label of the progress bar should be about a million not a thousand.
  2. Code executed should be /root/workspace/src/tasks/webshop_docker

The first problem is probably caused by the second. My guess is that you've missed some steps in tutorial.

from agentbench.

Z-ZHHH avatar Z-ZHHH commented on July 19, 2024

Thanks for your detailed reply!
I install the environment as follow:

pip install --upgrade pip
pip install -r requirements.txt
bash scripts/build_docker.sh
pip install -r src/tasks/os_interaction/requirements.txt
python src/tasks/os_interaction/images.py build -c configs/tasks/os_interaction/dev.yaml -r .

And I modify the llama2-chat agent file. The OS task could run successfully whereas the webshop meets the problem.

from agentbench.

zhc7 avatar zhc7 commented on July 19, 2024

The different between them is that OS task does not need to be executed in docker whereas webshop task locates in a docker image. I assume that you are trying to execute the webshop task outside of the docker. Please refer to https://github.com/THUDM/AgentBench/blob/main/docs/tutorial.md#how-to-run-all-tasks-in-agentbench. You may create an assignment with only webshop task.

from agentbench.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.