cn0303 commited on
Commit
bca1ea2
·
verified ·
1 Parent(s): 0e8e243

Fix spec-parser GPU window; clearer chart colours, unclipped label

Browse files
Files changed (3) hide show
  1. spec_brick.py +1 -1
  2. static/app.js +3 -1
  3. static/style.css +5 -5
spec_brick.py CHANGED
@@ -49,7 +49,7 @@ if _should_load():
49
  _state["tok"] = tok
50
  _state["model"] = model.to("cuda").eval()
51
 
52
- @spaces.GPU(duration=60)
53
  def _generate(text: str) -> str:
54
  if _state["model"] is None:
55
  _load()
 
49
  _state["tok"] = tok
50
  _state["model"] = model.to("cuda").eval()
51
 
52
+ @spaces.GPU(duration=120) # cold path = 3.4GB download + load + generate
53
  def _generate(text: str) -> str:
54
  if _state["model"] is None:
55
  _load()
static/app.js CHANGED
@@ -553,8 +553,10 @@ async function drawRoofline(speed) {
553
  const ux = lx(Math.min(Math.max(speed.eff_bw || speed.bw, xmin), xmax));
554
  const uy = ly(Math.min(Math.max(speed.tps, ymin), ymax));
555
  s += `<line x1="${ux}" y1="${ly(Math.min(Math.max(speed.lo, ymin), ymax))}" x2="${ux}" y2="${ly(Math.min(Math.max(speed.hi, ymin), ymax))}" class="rl-band"/>`;
 
 
556
  s += `<circle cx="${ux}" cy="${uy}" r="6" class="rl-you"/>` +
557
- `<text x="${ux + 10}" y="${uy + 4}" class="rl-you-label">you ≈${speed.tps} tok/s</text>`;
558
  }
559
  s += `</svg>
560
  <div class="rl-legend">
 
553
  const ux = lx(Math.min(Math.max(speed.eff_bw || speed.bw, xmin), xmax));
554
  const uy = ly(Math.min(Math.max(speed.tps, ymin), ymax));
555
  s += `<line x1="${ux}" y1="${ly(Math.min(Math.max(speed.lo, ymin), ymax))}" x2="${ux}" y2="${ly(Math.min(Math.max(speed.hi, ymin), ymax))}" class="rl-band"/>`;
556
+ // flip the label to the left when the dot sits near the right edge
557
+ const flip = ux > W * 0.72;
558
  s += `<circle cx="${ux}" cy="${uy}" r="6" class="rl-you"/>` +
559
+ `<text x="${flip ? ux - 10 : ux + 10}" y="${uy + 4}" class="rl-you-label" text-anchor="${flip ? "end" : "start"}">you ≈${speed.tps} tok/s</text>`;
560
  }
561
  s += `</svg>
562
  <div class="rl-legend">
static/style.css CHANGED
@@ -393,10 +393,10 @@ details.disc > summary:hover { color: var(--text-primary); }
393
  .rl-grid { stroke: var(--border); stroke-width: 1; opacity: .5; }
394
  .rl-tick { fill: var(--text-muted); font: 500 10.5px var(--font-body); }
395
  .rl-axis { fill: var(--text-secondary); font: 600 11.5px var(--font-body); }
396
- .rl-dot { opacity: .55; }
397
- .rl-p1 { fill: #5B6472; }
398
- .rl-p8 { fill: #8B93A3; }
399
- .rl-p14 { fill: #B9C0CC; }
400
  .rl-roof { stroke: var(--warn); stroke-width: 1.8; stroke-dasharray: 6 5; opacity: .9; }
401
  .rl-band { stroke: var(--accent); stroke-width: 5; opacity: .35; stroke-linecap: round; }
402
  .rl-you { fill: var(--accent); stroke: #fff; stroke-width: 1.5; }
@@ -404,7 +404,7 @@ details.disc > summary:hover { color: var(--text-primary); }
404
  .rl-legend { display: flex; flex-wrap: wrap; gap: var(--s-4); margin-top: var(--s-2); font-size: 12px; color: var(--text-muted); }
405
  .rl-legend .item { display: inline-flex; align-items: center; gap: 6px; }
406
  .rl-legend .sw { width: 10px; height: 10px; border-radius: 50%; }
407
- .rl-p1-sw { background: #5B6472; } .rl-p8-sw { background: #8B93A3; } .rl-p14-sw { background: #B9C0CC; }
408
  .rl-roof-sw { background: var(--warn); border-radius: 2px; height: 3px; width: 14px; }
409
  .rl-you-sw { background: var(--accent); }
410
  .viz-caption { font-size: 13px; color: var(--text-secondary); line-height: 1.6; margin-top: var(--s-3); }
 
393
  .rl-grid { stroke: var(--border); stroke-width: 1; opacity: .5; }
394
  .rl-tick { fill: var(--text-muted); font: 500 10.5px var(--font-body); }
395
  .rl-axis { fill: var(--text-secondary); font: 600 11.5px var(--font-body); }
396
+ .rl-dot { opacity: .6; }
397
+ .rl-p1 { fill: #2DD4BF; } /* ~1B runs: teal */
398
+ .rl-p8 { fill: #F472B6; } /* ~8B runs: pink */
399
+ .rl-p14 { fill: #93C5FD; } /* ~14B runs: light blue */
400
  .rl-roof { stroke: var(--warn); stroke-width: 1.8; stroke-dasharray: 6 5; opacity: .9; }
401
  .rl-band { stroke: var(--accent); stroke-width: 5; opacity: .35; stroke-linecap: round; }
402
  .rl-you { fill: var(--accent); stroke: #fff; stroke-width: 1.5; }
 
404
  .rl-legend { display: flex; flex-wrap: wrap; gap: var(--s-4); margin-top: var(--s-2); font-size: 12px; color: var(--text-muted); }
405
  .rl-legend .item { display: inline-flex; align-items: center; gap: 6px; }
406
  .rl-legend .sw { width: 10px; height: 10px; border-radius: 50%; }
407
+ .rl-p1-sw { background: #2DD4BF; } .rl-p8-sw { background: #F472B6; } .rl-p14-sw { background: #93C5FD; }
408
  .rl-roof-sw { background: var(--warn); border-radius: 2px; height: 3px; width: 14px; }
409
  .rl-you-sw { background: var(--accent); }
410
  .viz-caption { font-size: 13px; color: var(--text-secondary); line-height: 1.6; margin-top: var(--s-3); }