Skip to content

armgit / raea

Public Imported from GitHub
0

Render Anything Engine: tell your AI what to make. Videos, motion graphics, 3D and games as React and TypeScript, rendered on your own GPU. Rust + Bevy, macOS, Linux and Windows.

Stable Audio Open small off the Mac (docs/cloud-render.feature CR25): tools/sao/run.py gets an ONNX Runtime backend beside Core ML, with one sampler for both (the same numpy generator draws the start and every re-noise from the seed), so a backend changes only how each network is computed. The ONNX graphs are the same weights as three fp32 graphs (atauser001/stable-audio-open-small-onnx at a pinned revision, each file against its published SHA-256, its LICENSE and NOTICE kept beside them): cond on the CPU, the DiT and the decoder on CUDA when onnxruntime has it (--device auto|cpu|cuda), else the CPU. --backend defaults to Core ML on a Mac with its packages, else ONNX; --times prints each stage's seconds. setup.sh installs the ONNX build off a Mac (RAEA_SAO_BACKEND=coreml|onnx picks; onnxruntime-gpu with its CUDA and cuDNN wheels where nvidia-smi finds a GPU or RAEA_SAO_CUDA is set, else onnxruntime; sha256sum or shasum). sdk/cloud/deploy/modal/sao.py installs it into raea-models (/models/sao) and times it. Measured 11-17: the Core ML path writes the same bytes as before; ONNX on a T4 and on the CPU against the Mac's Core ML take of the same prompt and seed, 4 sounds, SNR 35.0 to 51.4 dB, correlation 0.9999 to 1.0000, log-spectrum difference 0.34 to 2.08 dB (two different sounds: -2 to -14 dB, 22 to 46 dB), so a sound keeps its cache key on every backend. A warm T4 process 5.3 s a sound (load 3.4, eight DiT steps 0.6, decode 0.6), 4 CPU cores 13 s (decode 6.8), the Mac's Core ML about 5 s.

shinyobjectzc808083f8607
diff --git a/sdk/cloud/deploy/modal/sao.py b/sdk/cloud/deploy/modal/sao.py
new file mode 100644
index 00000000..4cef75a3
--- /dev/null
+++ b/sdk/cloud/deploy/modal/sao.py
@@ -0,0 +1,102 @@
+# Stable Audio Open Small on raea's Modal GPUs (docs/cloud-render.feature CR24, CR25): tools/sao installed once into the
+# volume raea-models with its ONNX backend (/models/sao, what the farm names as RAEA_SAO), then sounds made on an
+# NVIDIA GPU and on the CPU in the same container, each as raea makes one (a process each, run.py --times). From
+# sdk/cloud:
+#
+# MODAL_PROFILE=raea modal run deploy/modal/sao.py --setup-only # the install (CPU, once)
+# MODAL_PROFILE=raea modal run deploy/modal/sao.py [--gpu L4] --out DIR # times and the wavs
+#
+# run.py's sampler is the same on every backend, from the same seed, so a wav here is compared with the Mac's Core ML
+# take of the same prompt and seed sample by sample (DIR/coreml-*.wav, made with tools/sao/run.py on the Mac).
+# The venv's Python comes from the image (/opt/uv-python), so every container of this image runs it.
+
+import json
+import os
+import shutil
+import subprocess
+import time
+
+import modal
+
+HERE = os.path.dirname(os.path.abspath(__file__))
+TOOL = os.path.normpath(os.path.join(HERE, "..", "..", "..", "..", "tools", "sao"))
+DIR = "/models/sao"
+models = modal.Volume.from_name("raea-models", create_if_missing=True, version=2)
+image = (
+ modal.Image.from_registry("debian:trixie-slim", add_python="3.12")
+ .apt_install("ca-certificates", "curl", "ffmpeg")
+ .pip_install("uv==0.8.0")
+ .env({"UV_PYTHON_INSTALL_DIR": "/opt/uv-python", "UV_PYTHON_PREFERENCE": "only-managed", "UV_CACHE_DIR": "/tmp/uv-cache"})
+ .run_commands("uv python install 3.11")
+ .add_local_dir(TOOL, "/tools/sao", ignore=["__pycache__", ".venv"])
+)
+app = modal.App("raea-sao", image=image)
+
+# (prompt, seed, seconds): what a game's or a film's foley asks for
+SOUNDS = [("a wooden door creaks open", 7, 3.0), ("footsteps on gravel", 1, 4.0), ("glass shatters on a stone floor", 3, 2.0),
+ ("heavy rain on a tin roof", 2, 6.0)]
+
+
[email protected](volumes={"/vol": models}, cpu=4, memory=8192, timeout=3600)
+def setup() -> dict:
+ # built at its own path on the container's disk (uv's temporary files fail on the volume, and the venv names its
+ # path), then copied to the volume, which is mounted elsewhere here; the CUDA build, though this container has none
+ t = time.time()
+ env = {**os.environ, "RAEA_SAO": DIR, "RAEA_SAO_FROM": "/nonexistent", "RAEA_SAO_BACKEND": "onnx", "RAEA_SAO_CUDA": "1"}
+ r = subprocess.run(["sh", "/tools/sao/setup.sh"], capture_output=True, text=True, env=env)
+ out = {"code": r.returncode, "setup_s": round(time.time() - t, 1), "log": (r.stderr or r.stdout)[-1500:]}
+ if r.returncode:
+ return out
+ t = time.time()
+ if os.path.exists("/vol/sao"):
+ shutil.rmtree("/vol/sao")
+ subprocess.run(["cp", "-a", DIR, "/vol/sao"], check=True)
+ models.commit()
+ out["copied_s"] = round(time.time() - t, 1)
+ out["size"] = subprocess.run(["du", "-sh", "/vol/sao"], capture_output=True, text=True).stdout.split()[0]
+ return out
+
+
[email protected](volumes={"/models": models}, gpu=["T4", "L4", "A10G"], cpu=4, memory=16384, timeout=3600)
+def bench(sounds: list, cpu_too: int = 2) -> dict:
+ gpu = subprocess.run(["nvidia-smi", "--query-gpu=name", "--format=csv,noheader"], capture_output=True, text=True).stdout.strip()
+ print(f"bench: {gpu}", flush=True)
+ py = f"{DIR}/.venv/bin/python"
+ if not os.path.exists(py):
+ raise SystemExit(f"no install at {DIR}: run with --setup-only first")
+ takes = []
+ for i, (prompt, seed, secs) in enumerate(sounds):
+ for device in ["cuda"] + (["cpu"] if i < cpu_too else []):
+ wav = f"/tmp/{device}-{i}.wav"
+ t = time.time()
+ r = subprocess.run([py, "-I", f"{DIR}/run.py", "--prompt", prompt, "--seed", str(seed), "--seconds", str(secs),
+ "--device", device, "--times", "--wav", wav], capture_output=True, text=True)
+ wall = time.time() - t
+ if r.returncode:
+ raise SystemExit(f"run.py {device} {prompt!r}: {r.stderr[-2000:]}")
+ times = json.loads(r.stderr.strip().splitlines()[-1])
+ print(f"bench: {device} {prompt!r}: wall {wall:.1f} s {times}", flush=True)
+ with open(wav, "rb") as f:
+ takes.append({"i": i, "prompt": prompt, "seed": seed, "seconds": secs, "device": device, "wall_s": round(wall, 2),
+ "times": times, "wav": f.read()})
+ return {"gpu": gpu, "takes": takes}
+
+
[email protected]_entrypoint()
+def main(gpu: str = "", out: str = "", setup_only: bool = False):
+ if setup_only:
+ print(json.dumps(setup.remote(), indent=1))
+ return
+ res = (bench.with_options(gpu=gpu) if gpu else bench).remote(SOUNDS)
+ if out:
+ os.makedirs(out, exist_ok=True)
+ for t in res["takes"]:
+ wav = t.pop("wav")
+ if out:
+ with open(os.path.join(out, f"onnx-{t['device']}-{t['i']}.wav"), "wb") as f:
+ f.write(wav)
+ report = json.dumps(res, indent=1)
+ print(report)
+ if out:
+ with open(os.path.join(out, "bench.json"), "w") as f:
+ f.write(report)
diff --git a/tools/sao/run.py b/tools/sao/run.py
index fed4442c..671627df 100644
--- a/tools/sao/run.py
+++ b/tools/sao/run.py
@@ -1,8 +1,15 @@
-"""Stable Audio Open Small on Core ML: one sound for a prompt and a seed, as a 44.1 kHz stereo WAV peak-normalised to
-full scale. rdb's asset store runs it for make("sao", prompt, seed, {seconds}) and keeps the bytes under their hash
-(sdk/react/docs/audio-stack.md, "Generated sources"); tools/sao/setup.sh installs it beside the models.
+"""Stable Audio Open Small on Core ML (a Mac) or ONNX Runtime (Linux, Windows, raea's cloud GPUs): one sound for a
+prompt and a seed, as a 44.1 kHz stereo WAV peak-normalised to full scale. rdb's asset store runs it for
+make("sao", prompt, seed, {seconds}) and keeps the bytes under their hash (sdk/react/docs/audio-stack.md, "Generated
+sources"); tools/sao/setup.sh installs it beside the models.
run.py --prompt TEXT --wav OUT.wav [--seed 1] [--seconds 4] [--steps 8] [--sampler pingpong|euler]
- [--dit-units cpu|gpu|all] [--dir DIR]
+ [--backend coreml|onnx] [--dit-units cpu|gpu|all] [--device auto|cpu|cuda] [--times] [--dir DIR]
+
+--backend is what the install has: Core ML on a Mac, else ONNX. Both run the same sampler from the same seed (one
+numpy generator draws the start and every re-noise), so a backend changes only how each network is computed. ONNX is
+the same weights as three fp32 graphs (atauser001/stable-audio-open-small-onnx: t5-base and the number embedder as
+`cond`, the DiT as `dit`, the Oobleck decoder as `dec`), on CUDA when onnxruntime has it (--device), else the CPU;
+`cond` always on the CPU, where it's small enough to be faster. --times prints each stage's seconds as JSON on stderr.
The pipeline is the Core ML packages' (mlboydaisuke/Stable-Audio-Open-Small-CoreML), driven the way its Swift sample
app drives them: T5 -> number embedder -> DiT x steps -> VAE decoder, at a fixed 256 latent frames (11.9 s), the output
@@ -14,7 +21,7 @@ distilled for, on the exact schedule stable-audio-tools uses.
This is ~/.cache/raea-sao/coreml_run.py (the 2026-10-15 spike) cut to what inference needs: numpy, coremltools and
Hugging Face's `tokenizers` reading t5-base's tokenizer.json from the install, so a run needs neither torch nor
stable-audio-tools nor the network. Same prompt and seed, same samples as the spike's runner (checked 2026-10-19)."""
-import argparse, os, shutil, subprocess, sys
+import argparse, json, os, shutil, subprocess, sys, time
SR, LAT, AUDIO = 44100, 256, 524288
TOKENS = 64
@@ -39,19 +46,8 @@ def tokenize(tok_path, prompt, np):
return np.array([e.ids], np.int32), np.array([e.attention_mask], np.int32)
-def main():
- ap = argparse.ArgumentParser()
- ap.add_argument("--prompt", required=True)
- ap.add_argument("--wav", required=True)
- ap.add_argument("--seed", type=int, default=1)
- ap.add_argument("--seconds", type=float, default=4.0)
- ap.add_argument("--steps", type=int, default=8)
- ap.add_argument("--sampler", default="pingpong", choices=["pingpong", "euler"])
- ap.add_argument("--dit-units", default="cpu", choices=["cpu", "gpu", "all"])
- ap.add_argument("--dir", default=os.path.dirname(os.path.abspath(__file__)))
- a = ap.parse_args()
-
- import numpy as np
+def coreml(a, np):
+ """The Core ML packages: T5 (raea's fp32), the number embedder and the decoder on CPU+GPU, the DiT on --dit-units."""
import coremltools as ct
units = {"cpu": ct.ComputeUnit.CPU_ONLY, "gpu": ct.ComputeUnit.CPU_AND_GPU, "all": ct.ComputeUnit.ALL}
@@ -71,30 +67,107 @@ def main():
t5 = compiled(f"{a.dir}/coreml/T5EncoderFP32.mlpackage", "gpu")
num, dit, dec = load("NumberEmbedder", "gpu"), load("DiT", a.dit_units), load("VAEDecoder", "gpu")
+ def cond(ids, mask, secs):
+ emb = t5.predict({"input_ids": ids, "attention_mask": mask})["text_embeddings"].astype(np.float32)
+ emb = emb * mask[..., None] # padding zeroed, as the PyTorch conditioner does
+ sec = num.predict({"normalized_seconds": np.array([min(secs, 256) / 256], np.float32)})["seconds_embedding"].astype(np.float32)
+ return np.concatenate([emb, sec[:, None, :]], axis=1), sec
+
+ def step(x, t, cross, sec):
+ return dit.predict({"latent": x, "timestep": np.array([t], np.float32), "cross_attn_cond": cross, "global_embed": sec})["velocity"].astype(np.float32)
+
+ def decode(x):
+ return dec.predict({"latent": x})["audio"][0].astype(np.float32)
+
+ return cond, step, decode, {"dit_units": a.dit_units}
+
+
+def onnx(a, np):
+ """The ONNX graphs on ONNX Runtime: the DiT and the decoder on CUDA when there is one (--device), cond on the CPU."""
+ import onnxruntime as ort
+
+ have = ort.get_available_providers()
+ device = a.device if a.device != "auto" else ("cuda" if "CUDAExecutionProvider" in have else "cpu")
+ if device == "cuda":
+ if "CUDAExecutionProvider" not in have:
+ raise SystemExit(f"sao: this onnxruntime has no CUDA ({', '.join(have)}): run tools/sao/setup.sh on a machine with an NVIDIA GPU")
+ # the CUDA and cuDNN libraries from their wheels (onnxruntime-gpu[cuda,cudnn]), not the system's
+ if hasattr(ort, "preload_dlls"):
+ ort.preload_dlls()
+ cpu = ["CPUExecutionProvider"]
+ main = ["CUDAExecutionProvider", "CPUExecutionProvider"] if device == "cuda" else cpu
+ o = ort.SessionOptions()
+ o.graph_optimization_level = ort.GraphOptimizationLevel.ORT_ENABLE_ALL
+ o.log_severity_level = 3
+ graph = lambda n, p: ort.InferenceSession(f"{a.dir}/onnx/{n}.onnx", o, providers=p)
+ cnd, dit, dec = graph("cond", cpu), graph("dit", main), graph("dec", main)
+ if device == "cuda" and "CUDAExecutionProvider" not in dit.get_providers():
+ raise SystemExit("sao: onnxruntime couldn't start CUDA for the DiT (its CUDA or cuDNN libraries are missing)")
+
+ def cond(ids, mask, secs):
+ cross, glob = cnd.run(["cross", "global"], {"input_ids": ids.astype(np.int64), "attention_mask": mask.astype(np.int64),
+ "seconds_total": np.array([secs], np.float32)})
+ return cross.astype(np.float32), glob.astype(np.float32)
+
+ def step(x, t, cross, sec):
+ return dit.run(["v"], {"x": x, "t": np.array([t], np.float32), "cross": cross, "global": sec})[0].astype(np.float32)
+
+ def decode(x):
+ return dec.run(["audio"], {"z": x})[0][0].astype(np.float32)
+
+ return cond, step, decode, {"device": device, "onnxruntime": ort.__version__}
+
+
+def main():
+ ap = argparse.ArgumentParser()
+ ap.add_argument("--prompt", required=True)
+ ap.add_argument("--wav", required=True)
+ ap.add_argument("--seed", type=int, default=1)
+ ap.add_argument("--seconds", type=float, default=4.0)
+ ap.add_argument("--steps", type=int, default=8)
+ ap.add_argument("--sampler", default="pingpong", choices=["pingpong", "euler"])
+ ap.add_argument("--backend", choices=["coreml", "onnx"])
+ ap.add_argument("--dit-units", default="cpu", choices=["cpu", "gpu", "all"])
+ ap.add_argument("--device", default="auto", choices=["auto", "cpu", "cuda"])
+ ap.add_argument("--times", action="store_true")
+ ap.add_argument("--dir", default=os.path.dirname(os.path.abspath(__file__)))
+ a = ap.parse_args()
+ backend = a.backend or ("coreml" if sys.platform == "darwin" and os.path.isdir(f"{a.dir}/coreml-ref") else "onnx")
+
+ import numpy as np
+
+ t0 = time.time()
+ cond, step, decode, info = (coreml if backend == "coreml" else onnx)(a, np)
+ times = {"backend": backend, **info, "load_s": time.time() - t0}
+
secs = min(a.seconds, AUDIO / SR)
+ t = time.time()
ids, mask = tokenize(f"{a.dir}/t5-tokenizer/tokenizer.json", a.prompt, np)
- emb = t5.predict({"input_ids": ids, "attention_mask": mask})["text_embeddings"].astype(np.float32)
- emb = emb * mask[..., None] # padding zeroed, as the PyTorch conditioner does
- sec = num.predict({"normalized_seconds": np.array([min(secs, 256) / 256], np.float32)})["seconds_embedding"].astype(np.float32)
- cross = np.concatenate([emb, sec[:, None, :]], axis=1)
+ cross, sec = cond(ids, mask, secs)
+ times["cond_s"] = time.time() - t
+ t = time.time()
rng = np.random.default_rng(a.seed)
x = rng.standard_normal((1, 64, LAT)).astype(np.float32)
ts = np.array(PINGPONG8, np.float32) if a.sampler == "pingpong" and a.steps == 8 else schedule(a.steps, np)
for s in range(a.steps):
- v = dit.predict({"latent": x, "timestep": np.array([ts[s]], np.float32), "cross_attn_cond": cross, "global_embed": sec})["velocity"]
- v = v.astype(np.float32)
+ v = step(x, ts[s], cross, sec)
if a.sampler == "pingpong": # predict the clean latent, then re-noise to the next level
den = x - ts[s] * v
x = (1 - ts[s + 1]) * den + ts[s + 1] * rng.standard_normal(x.shape).astype(np.float32)
else:
x = x + (ts[s + 1] - ts[s]) * v
- audio = dec.predict({"latent": x})["audio"][0].astype(np.float32)[:, : int(secs * SR)]
+ times["dit_s"] = time.time() - t
+ t = time.time()
+ audio = decode(x)[:, : int(secs * SR)]
+ times["dec_s"] = time.time() - t
audio = np.nan_to_num(audio)
audio = audio / max(np.abs(audio).max(), 1e-6)
pcm = (audio.T * 32767).astype("<i2").tobytes()
# ffmpeg writes the WAV, as the spike's runner did, so the bytes match it too
subprocess.run(["ffmpeg", "-v", "error", "-y", "-f", "s16le", "-ar", str(SR), "-ac", "2", "-i", "-", a.wav], input=pcm, check=True)
+ if a.times:
+ print(json.dumps({k: round(v, 3) if isinstance(v, float) else v for k, v in times.items()}), file=sys.stderr)
if __name__ == "__main__":
diff --git a/tools/sao/setup.sh b/tools/sao/setup.sh
index fed6e2b1..c1dcc1c3 100755
--- a/tools/sao/setup.sh
+++ b/tools/sao/setup.sh
@@ -1,6 +1,8 @@
#!/bin/sh
-# Stable Audio Open Small on Core ML (stabilityai/stable-audio-open-small, Stability AI Community License; the Core ML
-# packages are mlboydaisuke/Stable-Audio-Open-Small-CoreML) for raea-render's asset store: `make("sao", prompt, seed, {seconds})`
+# Stable Audio Open Small (stabilityai/stable-audio-open-small, Stability AI Community License) on Core ML on a Mac (the
+# packages are mlboydaisuke/Stable-Audio-Open-Small-CoreML), else on ONNX Runtime (the same weights as three fp32 graphs,
+# atauser001/stable-audio-open-small-onnx: 2 GB, with onnxruntime-gpu and its CUDA libraries where nvidia-smi finds a
+# GPU, else onnxruntime; RAEA_SAO_BACKEND=coreml|onnx picks) for raea-render's asset store: `make("sao", prompt, seed, {seconds})`
# renders one sound locally (run.py, copied in beside the models). Installs into $RAEA_SAO (default ~/.cache/raea-sao),
# outside the repo, as TokenSynth's lives in ~/.cache/raea-tokensynth. raea-render runs this itself the first time a sound is
# asked for and nothing is installed; `raea setup-audio` runs it on purpose.
@@ -21,6 +23,12 @@ FROM=${RAEA_SAO_FROM:-$HOME/.cache/raea-sao}
REPO=mlboydaisuke/Stable-Audio-Open-Small-CoreML
REV=8fa80903adebfeb62fc885c45505ac81628f3320
T5REV=a9723ea7f1b39c1eae772870f3b547bf6ef7e6c1
+ONNXREPO=atauser001/stable-audio-open-small-onnx
+ONNXREV=8f9544df5933b9ed4a7e8ed7fa6f77b3dd48ddce
+BACKEND=${RAEA_SAO_BACKEND:-}
+if [ -z "$BACKEND" ]; then
+ if [ "$(uname)" = Darwin ]; then BACKEND=coreml; else BACKEND=onnx; fi
+fi
mkdir -p "$DIR"
DIR=$(cd "$DIR" && pwd)
[ "$(cd "$FROM" 2>/dev/null && pwd)" = "$DIR" ] && FROM=
@@ -33,6 +41,10 @@ trap 'rm -rf "$DIR/.setup-lock"' EXIT
trap 'exit 130' INT TERM
cd "$DIR"
say() { echo "sao setup: $*" >&2; }
+# a file's SHA-256 (sha256sum on Linux, shasum on a Mac)
+sha256() {
+ if command -v sha256sum >/dev/null 2>&1; then sha256sum "$1" | cut -d' ' -f1; else shasum -a 256 "$1" | cut -d' ' -f1; fi
+}
# a file of the installation: kept if it's here, cloned from $FROM if that has it, else downloaded; checked against
# its SHA-256 when one is given. fetch DEST URL [SHA256]
@@ -46,7 +58,7 @@ fetch() {
say "downloading $dest"
curl -fL --retry 3 --progress-bar -o "$dest.part" "$url"
fi
- if [ -n "$sum" ] && [ "$(shasum -a 256 "$dest.part" | cut -d' ' -f1)" != "$sum" ]; then
+ if [ -n "$sum" ] && [ "$(sha256 "$dest.part")" != "$sum" ]; then
rm -f "$dest.part"
say "$dest doesn't match its SHA-256"
exit 1
@@ -55,12 +67,42 @@ fetch() {
}
# the venv: only what run.py imports. An existing one that already has them is left alone
-if ! .venv/bin/python -c "import numpy, coremltools, tokenizers" 2>/dev/null; then
+if [ "$BACKEND" = onnx ]; then
+ runtime="onnxruntime==1.23.2"
+ # an NVIDIA GPU: the CUDA build, with CUDA's and cuDNN's libraries as wheels (run.py preloads them)
+ command -v nvidia-smi >/dev/null 2>&1 && nvidia-smi -L >/dev/null 2>&1 && runtime="onnxruntime-gpu[cuda,cudnn]==1.23.2"
+ [ -n "${RAEA_SAO_CUDA:-}" ] && runtime="onnxruntime-gpu[cuda,cudnn]==1.23.2"
+ if ! .venv/bin/python -c "import numpy, onnxruntime, tokenizers" 2>/dev/null; then
+ say "making the venv ($runtime)"
+ [ -x .venv/bin/python ] || uv venv -q --python 3.11 .venv
+ VIRTUAL_ENV="$DIR/.venv" uv pip install -q --python .venv/bin/python "numpy==2.4.6" "tokenizers==0.23.3" "$runtime"
+ fi
+elif ! .venv/bin/python -c "import numpy, coremltools, tokenizers" 2>/dev/null; then
say "making the venv"
[ -x .venv/bin/python ] || uv venv -q --python 3.11 .venv
VIRTUAL_ENV="$DIR/.venv" uv pip install -q --python .venv/bin/python "numpy==2.4.6" "coremltools==9.0" "tokenizers==0.23.3"
fi
+# the tokenizer from the install, never the Hugging Face cache (the spike's runner read ~/.cache/huggingface)
+fetch t5-tokenizer/tokenizer.json "https://huggingface.co/google-t5/t5-base/resolve/$T5REV/tokenizer.json" \
+ d2acde0d8d71dd30a711834b07781b9c89feaac33fd332f60507699282740066
+
+if [ "$BACKEND" = onnx ]; then
+ # the graphs at a pinned revision, each against the SHA-256 its model card publishes; its licence and NOTICE (what
+ # the conversion changed) beside them
+ O=https://huggingface.co/$ONNXREPO/resolve/$ONNXREV
+ fetch onnx/cond.onnx "$O/cond.onnx" 847822809975d0c36a665594fad0312c4c225147910657820e9936b09014629c
+ fetch onnx/dit.onnx "$O/dit.onnx" 8e9c8b14baac4a26159d5ecf3d365ef5a097f321541f9548d62d136354a23d8b
+ fetch onnx/dec.onnx "$O/dec.onnx" 96029859b4d563f3aff266e97e715190e8d53278c6e27ab94095535a0da4c911
+ fetch onnx/LICENSE "$O/LICENSE"
+ fetch onnx/NOTICE "$O/NOTICE"
+ cp "$HERE/run.py" "$DIR/run.py"
+ date -u +%Y-%m-%dT%H:%M:%SZ > "$DIR/.ready"
+ du -sh "$DIR/onnx" "$DIR/.venv" >&2
+ say "ready in $DIR (ONNX)"
+ exit 0
+fi
+
HF=https://huggingface.co/$REPO/resolve/$REV
P=Data/com.apple.CoreML
while read -r name mlmodel weights; do
@@ -73,10 +115,6 @@ VAEDecoder 9614b1ec8ba90995c1b8e797da19ba21fc4acc67b0dfe0bbb28527dcbfc0a262 a8a1
DiT a118772c17fb831a6eda6a1ec2527f535d004064e27a8eb4597d5ae6d33a0576 c5444973f1a2bb3878a33049a4c559a1097de77fca8dc358aba38ee72033e97d
EOF
-# the tokenizer from the install, never the Hugging Face cache (the spike's runner read ~/.cache/huggingface)
-fetch t5-tokenizer/tokenizer.json "https://huggingface.co/google-t5/t5-base/resolve/$T5REV/tokenizer.json" \
- d2acde0d8d71dd30a711834b07781b9c89feaac33fd332f60507699282740066
-
T5=coreml/T5EncoderFP32.mlpackage
# made under another name until it's whole (coremltools insists on the .mlpackage extension)
PART=coreml/T5EncoderFP32.part.mlpackage