Files
Robot_Arm/ml/prep/vendor_ort.sh
T

17 lines
939 B
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/usr/bin/env bash
# 把 onnxruntime-web 1.20.1 放到 webapp/vendor/ort/(离线部署 &ortLocal=1、R4/R9 探针不依赖 CDN)。
# 2026-10-18 第六轮(审查 A-3 / B-3):第六轮实测 jsdelivr 间歇不可达;WebGPU 需要 ort.webgpu.min.js 与 jsep 版 wasm。
# 已存在且版本对就跳过。用法:bash ml/prep/vendor_ort.sh
set -e
cd "$(dirname "$0")/../.."
V=1.20.1; D=webapp/vendor/ort
if [ -f $D/VERSION ] && [ "$(cat $D/VERSION)" = $V ]; then echo "[ort] $D 已是 $V,跳过"; exit 0; fi
T=$(mktemp -d); trap 'rm -rf "$T"' EXIT
(cd "$T" && npm pack onnxruntime-web@$V --silent >/dev/null && tar xzf onnxruntime-web-$V.tgz)
mkdir -p $D
for f in ort.min.js ort.webgpu.min.js ort-wasm-simd-threaded.wasm ort-wasm-simd-threaded.mjs ort-wasm-simd-threaded.jsep.wasm ort-wasm-simd-threaded.jsep.mjs; do
cp "$T/package/dist/$f" $D/
done
echo $V > $D/VERSION
echo "[ort] 已放到 $D($(du -sh $D | cut -f1))"