Skip to content

Commit b2e87db

Browse files
committed
rename
1 parent 8829377 commit b2e87db

4 files changed

Lines changed: 20 additions & 20 deletions

File tree

‎robot_client/examples/python/minimal_example.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def make_observation() -> dict:
2323
return {
2424
"images": [
2525
{
26-
"name": "image",
26+
"name": "observation.images.front",
2727
"image": np.random.randint(0, 256, (IMAGE_HEIGHT, IMAGE_WIDTH, 3), dtype=np.uint8),
2828
}
2929
],

‎tools/quant/README_zh.md‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -48,15 +48,15 @@ components:
4848

4949
我们已经写好了一个shell来使用quant工具,quant/shell/quant.sh。如果要使用,我们首先需要对其做一些基本配置上的更改,可以设置的主要变量有:
5050

51-
| 变量 | 说明 |
52-
| ---------------------- | ------------------------------------------------------------------------------------------------------------- |
53-
| `REPO_ROOT` | 仓库根目录 |
54-
| `SRC_GGUF_DIR` | 源 GGUF 文件目录,供 YAML 中的 `${SRC_GGUF_DIR}` 引用 |
55-
| `QUANT_OUTPUT_DIR` | 量化后 GGUF 的输出目录,供 YAML 中的 `${QUANT_OUTPUT_DIR}` 引用 |
56-
| `MODEL_QUANT_PYTHON` | quant conda 环境中的 Python 路径,可以通过 `which python` 找到 conda 环境的 bin |
57-
| `PLAN_PATH` | quant plan YAML 路径 |
58-
| `QUANT_BUILD_DIR`* | 脚本只会在这个目录下查找 `libggml-base` / `ggml-base.dll`,如果没有,则会在该文件夹自动构建 `ggml-base` |
59-
| `GGML_BASE_LIB`* | 已有 `libggml-base` / `ggml-base.dll` 路径;不设置时脚本会尝试自动构建和查找 |
51+
| 变量 | 说明 |
52+
| ---------------------- | ------------------------------------------------------------------------------------------------------------ |
53+
| `ROBOT_CPP_ROOT` | 仓库根目录 |
54+
| `SRC_GGUF_DIR` | 源 GGUF 文件目录,供 YAML 中的`${SRC_GGUF_DIR}` 引用 |
55+
| `QUANT_OUTPUT_DIR` | 量化后 GGUF 的输出目录,供 YAML 中的`${QUANT_OUTPUT_DIR}` 引用 |
56+
| `MODEL_QUANT_PYTHON` | quant conda 环境中的 Python 路径,可以通过`which python` 找到 conda 环境的 bin |
57+
| `PLAN_PATH` | quant plan YAML 路径 |
58+
| `QUANT_BUILD_DIR`* | 脚本只会在这个目录下查找`libggml-base` / `ggml-base.dll`,如果没有,则会在该文件夹自动构建 `ggml-base` |
59+
| `GGML_BASE_LIB`* | 已有`libggml-base` / `ggml-base.dll` 路径;不设置时脚本会尝试自动构建和查找 |
6060

6161
> *我们需要使用ggml的runtime库来进行量化,因此其需要ggml-base这个库,不同平台下,该库的名字也有变化,因此如果要填写 `GGML_BASE_LIB`,需要参考不同平台:
6262
>

‎tools/quant/quantize-vla-gguf.py‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
from typing import Any
1717

1818

19-
VLA_ROOT = Path(__file__).resolve().parents[2]
20-
GGUF_PY = VLA_ROOT / "third_party" / "llama.cpp" / "gguf-py"
19+
ROOT = Path(__file__).resolve().parents[2]
20+
GGUF_PY = ROOT / "third_party" / "llama.cpp" / "gguf-py"
2121
if not GGUF_PY.exists():
2222
raise SystemExit("third_party/llama.cpp/gguf-py is required; initialize the llama.cpp submodule")
2323

@@ -190,7 +190,7 @@ def expand_path(value: Any) -> Path:
190190
text = re.sub(r"\$\{([^}]+)\}", expand_var_expr, str(value))
191191
path = Path(os.path.expanduser(text))
192192
if not path.is_absolute():
193-
path = VLA_ROOT / path
193+
path = ROOT / path
194194
return path
195195

196196

@@ -235,7 +235,7 @@ def ggml_base_candidates() -> list[Path]:
235235
"ggml-base*.dll",
236236
"libggml-base*.dll",
237237
)
238-
for build_dir in sorted(VLA_ROOT.glob("build*")):
238+
for build_dir in sorted(ROOT.glob("build*")):
239239
for path in build_dir.rglob("*"):
240240
if any(fnmatch.fnmatchcase(path.name, pattern) for pattern in patterns):
241241
candidates.append(path)

‎tools/quant/shell/quant.sh‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
#!/usr/bin/env bash
22
set -euo pipefail
33

4-
REPO_ROOT="${REPO_ROOT:?must be set}" # The root directory of the repository
4+
ROBOT_CPP_ROOT="${ROBOT_CPP_ROOT:?must be set}" # The root directory of the repository
55
export SRC_GGUF_DIR="${SRC_GGUF_DIR:?SRC_GGUF_DIR must be set}" # source GGUF directories
66
export QUANT_OUTPUT_DIR="${QUANT_OUTPUT_DIR:?QUANT_OUTPUT_DIR must be set}" # output directory for quantized models
77
MODEL_QUANT_PYTHON="${MODEL_QUANT_PYTHON:?MODEL_QUANT_PYTHON must be set}" # Python interpreter path
8-
PLAN_PATH="${PLAN_PATH:-${REPO_ROOT}/tools/quant/config/smolvla_origin.yaml}" # plan yaml path
8+
PLAN_PATH="${PLAN_PATH:-${ROBOT_CPP_ROOT}/tools/quant/config/smolvla_origin.yaml}" # plan yaml path
99

1010

1111
PYTHON_BIN="${PYTHON_BIN:-${MODEL_QUANT_PYTHON}}"
1212
CMAKE_BIN="${CMAKE_BIN:-cmake}"
13-
QUANT_BUILD_DIR="${QUANT_BUILD_DIR:-${REPO_ROOT}/build_model_quant}"
13+
QUANT_BUILD_DIR="${QUANT_BUILD_DIR:-${ROBOT_CPP_ROOT}/build_model_quant}"
1414
GGML_BASE_LIB="${GGML_BASE_LIB:-}" # path to the ggml-base runtime library (libggml-base)
1515

1616
find_ggml_base_lib() {
@@ -38,7 +38,7 @@ if [[ -z "${GGML_BASE_LIB}" ]]; then
3838
fi
3939

4040
if [[ -z "${GGML_BASE_LIB}" || ! -f "${GGML_BASE_LIB}" || "${FORCE_GGML_BASE_BUILD:-0}" == "1" ]]; then
41-
"${CMAKE_BIN}" -S "${REPO_ROOT}" -B "${QUANT_BUILD_DIR}" \
41+
"${CMAKE_BIN}" -S "${ROBOT_CPP_ROOT}" -B "${QUANT_BUILD_DIR}" \
4242
-DCMAKE_BUILD_TYPE=Release \
4343
-DROBOT_CPP_BUILD_ROBOT_SERVER=OFF
4444
"${CMAKE_BIN}" --build "${QUANT_BUILD_DIR}" --target ggml-base --config Release --parallel "$(sysctl -n hw.logicalcpu 2>/dev/null || nproc 2>/dev/null || echo 4)"
@@ -52,10 +52,10 @@ fi
5252
export GGML_BASE_LIB
5353

5454
"${PYTHON_BIN}" \
55-
"${REPO_ROOT}/tools/quant/quantize-vla-gguf.py" \
55+
"${ROBOT_CPP_ROOT}/tools/quant/quantize-vla-gguf.py" \
5656
"${PLAN_PATH}" \
5757
--dry-run
5858

5959
"${PYTHON_BIN}" \
60-
"${REPO_ROOT}/tools/quant/quantize-vla-gguf.py" \
60+
"${ROBOT_CPP_ROOT}/tools/quant/quantize-vla-gguf.py" \
6161
"${PLAN_PATH}"

0 commit comments

Comments
 (0)