Download apps/web/scripts/_debug_jambuddy.cjs from salgadev/jam-buddy: direct link, hf CLI and curl.
- Browser
- Download file 1.07 kB
-
https://huggingface.co/spaces/salgadev/jam-buddy/resolve/main/apps/web/scripts/_debug_jambuddy.cjs
- Command line
-
hf download hf://spaces/salgadev/jam-buddy/apps/web/scripts/_debug_jambuddy.cjs
-
curl -L -o _debug_jambuddy.cjs https://huggingface.co/spaces/salgadev/jam-buddy/resolve/main/apps/web/scripts/_debug_jambuddy.cjs
1.07 kB
| const { execFile } = require("node:child_process"); | |
| const { promisify } = require("node:util"); | |
| const execFileAsync = promisify(execFile); | |
| const { join } = require("node:path"); | |
| const repoRoot = join(__dirname, "..", "..", ".."); | |
| const python = join(repoRoot, "stable-audio-3", ".venv", "Scripts", "python.exe"); | |
| const script = join(repoRoot, "tools", "jam_buddy.py"); | |
| const out = join(require("node:os").tmpdir(), "out.wav"); | |
| execFileAsync( | |
| python, | |
| [script, "--bpm", "120", "--out", out], | |
| { timeout: 300000, maxBuffer: 10 * 1024 * 1024 }, | |
| ) | |
| .then(({ stdout }) => { | |
| console.log("OK. stdout bytes:", stdout.length); | |
| console.log("tail:", stdout.slice(-200)); | |
| }) | |
| .catch((err) => { | |
| console.log("ERROR name:", err.name); | |
| console.log("ERROR code:", err.code); | |
| console.log("ERROR killed:", err.killed); | |
| console.log("ERROR signal:", err.signal); | |
| console.log("ERROR message:", err.message); | |
| console.log("ERROR stderr:", JSON.stringify(err.stderr)); | |
| console.log("ERROR stdout:", JSON.stringify(err.stdout?.slice(-300))); | |
| }); | |