Model card: n0_twam package rename
Browse files
README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
---
|
| 2 |
license: cc-by-nc-sa-4.0
|
| 3 |
-
library_name:
|
| 4 |
pipeline_tag: robotics
|
| 5 |
tags:
|
| 6 |
- robotics
|
|
@@ -64,12 +64,12 @@ bundle = snapshot_download("NeoteAI/n0-twam-base")
|
|
| 64 |
|
| 65 |
```python
|
| 66 |
import torch
|
| 67 |
-
from
|
| 68 |
|
| 69 |
model = load_mot_checkpoint(f"{bundle}/transformer",
|
| 70 |
torch_dtype=torch.bfloat16, torch_device="cuda")
|
| 71 |
-
print(
|
| 72 |
-
# ->
|
| 73 |
```
|
| 74 |
|
| 75 |
### 3b. Or serve it (observation → action)
|
|
@@ -80,21 +80,21 @@ every component the server needs, including the training-time action norm stats
|
|
| 80 |
websocket server:
|
| 81 |
|
| 82 |
```python
|
| 83 |
-
# in
|
| 84 |
twam_server_cfg.wan22_pretrained_model_name_or_path = "<path to the downloaded bundle>"
|
| 85 |
```
|
| 86 |
|
| 87 |
```bash
|
| 88 |
-
export PYTHONPATH=$PWD:$PWD/
|
| 89 |
export RANK=0 LOCAL_RANK=0 WORLD_SIZE=1 MASTER_ADDR=127.0.0.1 MASTER_PORT=29988
|
| 90 |
-
python -m
|
| 91 |
```
|
| 92 |
|
| 93 |
Query it from a client (a reset with a language prompt, then per-step observations):
|
| 94 |
|
| 95 |
```python
|
| 96 |
import numpy as np
|
| 97 |
-
from
|
| 98 |
|
| 99 |
client = WebsocketClientPolicy("127.0.0.1", 29601)
|
| 100 |
client.infer({"reset": True, "prompt": "pick up the object"})
|
|
|
|
| 1 |
---
|
| 2 |
license: cc-by-nc-sa-4.0
|
| 3 |
+
library_name: n0_twam
|
| 4 |
pipeline_tag: robotics
|
| 5 |
tags:
|
| 6 |
- robotics
|
|
|
|
| 64 |
|
| 65 |
```python
|
| 66 |
import torch
|
| 67 |
+
from n0_twam.models.utils import load_mot_checkpoint
|
| 68 |
|
| 69 |
model = load_mot_checkpoint(f"{bundle}/transformer",
|
| 70 |
torch_dtype=torch.bfloat16, torch_device="cuda")
|
| 71 |
+
print(f"{sum(p.numel() for p in model.parameters()) / 1e9:.2f} B params")
|
| 72 |
+
# -> 7.16 B params
|
| 73 |
```
|
| 74 |
|
| 75 |
### 3b. Or serve it (observation → action)
|
|
|
|
| 80 |
websocket server:
|
| 81 |
|
| 82 |
```python
|
| 83 |
+
# in n0_twam/configs/twam_server_cfg.py
|
| 84 |
twam_server_cfg.wan22_pretrained_model_name_or_path = "<path to the downloaded bundle>"
|
| 85 |
```
|
| 86 |
|
| 87 |
```bash
|
| 88 |
+
export PYTHONPATH=$PWD:$PWD/n0_twam CUDA_VISIBLE_DEVICES=0
|
| 89 |
export RANK=0 LOCAL_RANK=0 WORLD_SIZE=1 MASTER_ADDR=127.0.0.1 MASTER_PORT=29988
|
| 90 |
+
python -m n0_twam.n0_twam_server --config-name twam_server --port 29601
|
| 91 |
```
|
| 92 |
|
| 93 |
Query it from a client (a reset with a language prompt, then per-step observations):
|
| 94 |
|
| 95 |
```python
|
| 96 |
import numpy as np
|
| 97 |
+
from n0_twam.utils.Simple_Remote_Infer.deploy.websocket_client_policy import WebsocketClientPolicy
|
| 98 |
|
| 99 |
client = WebsocketClientPolicy("127.0.0.1", 29601)
|
| 100 |
client.infer({"reset": True, "prompt": "pick up the object"})
|