Skip to content

Commit 90fb852

Browse files
committed
chore!: rename agents -> vlagents
1 parent ef54636 commit 90fb852

12 files changed

Lines changed: 40 additions & 39 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ wandb
1212
run_logs
1313
.ipynb_checkpoints
1414
.not*
15+
dist

.vscode/launch.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@
1212
"console": "integratedTerminal",
1313
"args": ["-vv"],
1414
"justMyCode": true,
15-
"cwd": "${workspaceFolder}"
15+
"cwd": "${workspaceFolder}/src"
1616
},
1717
{
1818
"name": "Debug server with test policy",
1919
"type": "debugpy",
2020
"request": "launch",
21-
"module": "agents",
21+
"module": "vlagents",
2222
"console": "integratedTerminal",
2323
"args": ["start-server", "test", "--port=8080", "--host=localhost", "--kwargs={}"],
2424
"justMyCode": true,

README.md

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# Agents
2-
Agents is a python library that allows to separate next action prediction from policy networks from action execution in simulated or real environments.
1+
# VLAgents
2+
VLAgents is a python library that allows to separate next action prediction from policy networks from action execution in simulated or real environments.
33
It defines an interface for policies and for environments.
44
The policies run independent in their own virtual environment, potentially on a different computer, and can be queried for an action (in principle similar to the chatgpt api).
55

@@ -15,18 +15,18 @@ The work also includes a section on related engineering challenges regarding jax
1515

1616
### Local Installation
1717
```shell
18-
git clone https://github.com/juelg/agents.git
19-
cd agents
18+
git clone https://github.com/juelg/vlagents.git
19+
cd vlagents
2020
pip install -ve .
2121
```
2222

2323
### Repo Installation
2424
```shell
25-
pip install git+https://github.com/juelg/agents.git
25+
pip install git+https://github.com/juelg/vlagents.git
2626
```
2727

2828
### Environment and Policy Installation
29-
On top of agents you can then install a simulation environment where the agent acts.
29+
On top of vlagents you can then install a simulation environment where the agent acts.
3030
We currently support [maniskill](https://github.com/haosulab/ManiSkill) with more to come.
3131
In order to avoid dependency conflicts, use a second conda/pip environment to install your policy.
3232
We currently support [octo](https://github.com/octo-models/octo) and [openvla](https://github.com/openvla/openvla).
@@ -40,7 +40,7 @@ conda install nvidia/label/cuda-11.8.0::cuda --no-channel-priority
4040
conda install conda-forge::cudnn=8.9
4141
# octo dependencies
4242
pip install git+https://github.com/octo-models/octo.git@241fb3514b7c40957a86d869fecb7c7fc353f540
43-
pip install -r agents/utils/fixed_octo_requirements.txt
43+
pip install -r vlagents/utils/fixed_octo_requirements.txt
4444
# for gpu support:
4545
pip install --upgrade "jax[cuda11_pip]==0.4.20" -f https://storage.googleapis.com/jax-releases/jax_cuda_releases.html
4646
```
@@ -54,9 +54,9 @@ print(xla_bridge.get_backend().platform)
5454
```
5555

5656

57-
Install the agents library on top:
57+
Install the vlagents library on top:
5858
```shell
59-
pip install git+https://github.com/juelg/agents.git
59+
pip install git+https://github.com/juelg/vlagents.git
6060
```
6161

6262
For more details, see the [Octo github page](https://github.com/octo-models/octo).
@@ -93,9 +93,9 @@ Install OpenVLA
9393
pip install git+https://github.com/openvla/openvla.git@46b752f477cc5773cc1234b2e82c0e2130e4e890
9494
```
9595

96-
Install the agents library on top:
96+
Install the vlagents library on top:
9797
```shell
98-
pip install git+https://github.com/juelg/agents.git
98+
pip install git+https://github.com/juelg/vlagents.git
9999
```
100100

101101
For more details, see the [OpenVLA github page](https://github.com/openvla/openvla).
@@ -129,25 +129,25 @@ git clone git@github.com:facebookresearch/vjepa2.git
129129
cd vjepa2
130130
pip install -e .
131131

132-
pip install git+https://github.com/juelg/agents.git
132+
pip install git+https://github.com/juelg/vlagents.git
133133
pip install -ve .
134134

135135
```
136136

137137
## Usage
138-
To start an agents server use the `start-server` command where `kwargs` is a dictionary of the constructor arguments of the policy you want to start e.g.
138+
To start an vlagents server use the `start-server` command where `kwargs` is a dictionary of the constructor arguments of the policy you want to start e.g.
139139
```shell
140140
# octo
141-
python -m agents start-server octo --host localhost --port 8080 --kwargs '{"checkpoint_path": "hf://Juelg/octo-base-1.5-finetuned-maniskill", "checkpoint_step": None, "horizon": 1, "unnorm_key": []}'
141+
python -m vlagents start-server octo --host localhost --port 8080 --kwargs '{"checkpoint_path": "hf://Juelg/octo-base-1.5-finetuned-maniskill", "checkpoint_step": None, "horizon": 1, "unnorm_key": []}'
142142

143143
# openvla
144-
python -m agents start-server openvla --host localhost --port 8080 --kwargs '{"checkpoint_path": "Juelg/openvla-7b-finetuned-maniskill", "device": "cuda:0", "attn_implementation": "flash_attention_2", "unnorm_key": "maniskill_human:7.0.0", "checkpoint_step": 40000}'
144+
python -m vlagents start-server openvla --host localhost --port 8080 --kwargs '{"checkpoint_path": "Juelg/openvla-7b-finetuned-maniskill", "device": "cuda:0", "attn_implementation": "flash_attention_2", "unnorm_key": "maniskill_human:7.0.0", "checkpoint_step": 40000}'
145145

146146
# openpi
147-
python -m agents start-server openpi --port=8080 --host=localhost --kwargs='{"checkpoint_path": "<path to checkpoint>/{checkpoint_step}", "model_name": "pi0_rcs", "checkpoint_step": <checkpoint_step>}' # leave "{checkpoint_step}" it will be replaced, "model_name" is the key for the training config
147+
python -m vlagents start-server openpi --port=8080 --host=localhost --kwargs='{"checkpoint_path": "<path to checkpoint>/{checkpoint_step}", "model_name": "pi0_rcs", "checkpoint_step": <checkpoint_step>}' # leave "{checkpoint_step}" it will be replaced, "model_name" is the key for the training config
148148

149149
# vjepa2-ac
150-
python -m agents start-server vjepa --port=20997 --host=0.0.0.0 --kwargs='{"cfg_path": "configs/inference/vjepa2-ac-vitg/<your_config>.yaml", "model_name": "vjepa2_ac_vit_giant", "default_checkpoint_path": "../.cache/torch/hub/checkpoints/vjepa2-ac-vitg.pt"}'
150+
python -m vlagents start-server vjepa --port=20997 --host=0.0.0.0 --kwargs='{"cfg_path": "configs/inference/vjepa2-ac-vitg/<your_config>.yaml", "model_name": "vjepa2_ac_vit_giant", "default_checkpoint_path": "../.cache/torch/hub/checkpoints/vjepa2-ac-vitg.pt"}'
151151
```
152152

153153

@@ -159,12 +159,12 @@ In both cases environment and arguments as well as policy and arguments and wand
159159
## Contribution
160160

161161
### New Policy
162-
In order to extend the library with a new policy network, extend the `Agent` class in [policies.py](src/agents/policies.py).
162+
In order to extend the library with a new policy network, extend the `Agent` class in [policies.py](src/vlagents/policies.py).
163163
It is important to only invoke policy specific imports in the class functions, as each policy can have its own dependencies.
164164

165165

166166
### New Environment
167-
In order to extend the library with a new agent environment, extend the `EvaluatorEnv` class in [evaluator_envs.py](src/agents/evaluator_envs.py).
167+
In order to extend the library with a new agent environment, extend the `EvaluatorEnv` class in [evaluator_envs.py](src/vlagents/evaluator_envs.py).
168168

169169

170170
### Developer Tools

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ requires = ["setuptools"]
33
build-backend = "setuptools.build_meta"
44

55
[project]
6-
name = "agents"
6+
name = "vlagents"
77
version = "0.0.1"
88
description = "Modular VLA and Environment interfaces."
99
dependencies = [

src/tests/test_connection.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33

44
import numpy as np
55

6-
from agents.client import RemoteAgent
7-
from agents.evaluator_envs import start_server
8-
from agents.policies import Act, Obs
6+
from vlagents.client import RemoteAgent
7+
from vlagents.evaluator_envs import start_server
8+
from vlagents.policies import Act, Obs
99

1010

1111
def _test_connection(agent: RemoteAgent):
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@
1515
# when started from jupyter notebook
1616
os.environ["MPLBACKEND"] = "Agg"
1717

18-
from agents.evaluator_envs import AgentConfig, EvalConfig, evaluation, write_results
19-
from agents.policies import AGENTS
20-
from agents.server import AgentService
18+
from vlagents.evaluator_envs import AgentConfig, EvalConfig, evaluation, write_results
19+
from vlagents.policies import AGENTS
20+
from vlagents.server import AgentService
2121

22-
main_app = typer.Typer(help="CLI tool for the agents library.")
22+
main_app = typer.Typer(help="CLI tool for the vlagents library.")
2323

2424

2525
def wandb_log_git_diff(path: str):
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import rpyc
1010
import simplejpeg
1111

12-
from agents.policies import Act, Agent, CameraDataType, Obs, SharedMemoryPayload
12+
from vlagents.policies import Act, Agent, CameraDataType, Obs, SharedMemoryPayload
1313

1414

1515
def dataclass_from_dict(klass, d):
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@
1818
from simple_slurm import Slurm
1919
from tqdm import tqdm
2020

21-
from agents.client import RemoteAgent
22-
from agents.policies import Act, Agent, Obs
23-
from agents.wrappers import HumanCameraWrapper
21+
from vlagents.client import RemoteAgent
22+
from vlagents.policies import Act, Agent, Obs
23+
from vlagents.wrappers import HumanCameraWrapper
2424

2525
logging.basicConfig(
2626
format="%(asctime)s,%(msecs)d %(name)s %(levelname)s %(message)s",
@@ -339,7 +339,7 @@ def start_server(
339339
cmd = [
340340
python_path.format(agent_name=agent_name),
341341
"-m",
342-
"agents",
342+
"vlagents",
343343
"start-server",
344344
f"{agent_name}",
345345
f"--port={port}",
@@ -415,7 +415,7 @@ def run_eval_during_training(
415415
cmd = ["python"]
416416
cmd += [
417417
"-m",
418-
"agents" "run-eval-during-training",
418+
"vlagents" "run-eval-during-training",
419419
f"--agent-cfg={json.dumps(asdict(agent_cfg))}" f"--episodes={episodes}",
420420
f"--n-processes={n_processes}",
421421
f"--eval-cfgs={json.dumps([asdict(cfg) for cfg in eval_cfgs])}",
@@ -452,7 +452,7 @@ def run_eval_post_training(
452452
shlex.join(
453453
[
454454
"-m",
455-
"agents",
455+
"vlagents",
456456
"run-eval-post-training",
457457
f"--agent-cfg={json.dumps(asdict(agent_cfg))}",
458458
f"--episodes={episodes}",
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ def act(self, obs: Obs) -> Act:
343343
)
344344
action_chunk = self.policy.infer(observation)["actions"]
345345

346-
# convert gripper action into agents format
346+
# convert gripper action into vlagents format
347347
action_chunk[:, -1] = 1 - action_chunk[:, -1]
348348
self._cached_action_chunk = action_chunk
349349

0 commit comments

Comments
 (0)