diff --git a/tinygrad/viz/js/index.js b/tinygrad/viz/js/index.js index dabedcf638..39aa6136f9 100644 --- a/tinygrad/viz/js/index.js +++ b/tinygrad/viz/js/index.js @@ -185,7 +185,7 @@ function renderMemoryGraph(graph) { return `${p0.join(' ')} ${p1.join(' ')}`; }).attr("fill", d => `#${colors[d.buf.num % colors.length]}`).on("mouseover", (e, { id, buf, x }) => { d3.select(e.currentTarget).attr("stroke", "rgba(26, 27, 38, 0.8)").attr("stroke-width", 0.8); - const metadata = document.querySelector(".container.metadata"); + const metadata = document.querySelector(".metadata"); document.getElementById("current-buf")?.remove(); const { num, dtype, nbytes, ...rest } = buf; let label = `\nalive for ${pluralize(x[x.length-1]-x[0], 'timestep')}`; diff --git a/tinygrad/viz/serve.py b/tinygrad/viz/serve.py index 99c9c4f502..62b0a2fb20 100755 --- a/tinygrad/viz/serve.py +++ b/tinygrad/viz/serve.py @@ -20,8 +20,9 @@ uops_colors = {Ops.LOAD: "#ffc0c0", Ops.STORE: "#87CEEB", Ops.CONST: "#e0e0e0", # NOTE: if any extra rendering in VIZ fails, we don't crash def pcall(fxn:Callable[..., str], *args, **kwargs) -> str: + err = kwargs.pop("err", "") try: return fxn(*args, **kwargs) - except Exception: return f"ERROR in {fxn.__name__}\n{kwargs.get('err', '')}" + except Exception: return f"ERROR in {fxn.__name__}\n{err}" # ** Metadata for a track_rewrites scope