code2lora commited on
Commit
ec67308
·
verified ·
1 Parent(s): 70f3950

Open on latest commit in live mode; cleaner chart

Browse files
Files changed (1) hide show
  1. app.py +6 -4
app.py CHANGED
@@ -244,8 +244,8 @@ def timeline_plot(safe: str, k: int) -> Figure:
244
  fig = Figure(figsize=(9, 2.4), dpi=110)
245
  ax = fig.add_subplot(111)
246
  if d["live_only"]:
247
- ax.bar(x, [len(g) for g in d["qnas"]], color="#c5cbf5", width=0.9, label="Test assertions added")
248
- ax.set_ylabel("Assertions\nadded")
249
  else:
250
  ax.plot(x, rolling("base_em"), color="#9aa3b5", lw=1.6, label="Base model")
251
  ax.plot(x, rolling("c2l_em"), color="#4f5bd5", lw=2.2, label="Code2LoRA (adapter at each commit)")
@@ -253,12 +253,12 @@ def timeline_plot(safe: str, k: int) -> Figure:
253
  ax.axvline(t + 1, color="#22c3a6", alpha=0.18, lw=1)
254
  ax.set_ylim(0, 100)
255
  ax.set_ylabel("Exact match %\n(rolling)")
 
256
  ax.axvline(k + 1, color="#ff6b8b", lw=2)
257
  ax.set_xlim(0.5, max(2, len(cs)) + 0.5)
258
  ax.set_xlabel("Commit")
259
  for s in ("top", "right"):
260
  ax.spines[s].set_visible(False)
261
- ax.legend(loc="upper left" if d["live_only"] else "lower right", fontsize=8, frameon=False)
262
  fig.tight_layout()
263
  return fig
264
 
@@ -318,7 +318,9 @@ def assertion_panel(safe: str, k: int, i: Optional[int], adapted_k: Optional[int
318
 
319
  def default_commit(safe: str) -> int:
320
  d = load_repo(safe)
321
- return d["jump_targets"][0] if d["jump_targets"] else len(d["commits"]) - 1
 
 
322
 
323
 
324
  def on_repo(safe: str):
 
244
  fig = Figure(figsize=(9, 2.4), dpi=110)
245
  ax = fig.add_subplot(111)
246
  if d["live_only"]:
247
+ ax.bar(x, [len(g) for g in d["qnas"]], color="#c5cbf5", width=0.9)
248
+ ax.set_ylabel("Test assertions\nadded")
249
  else:
250
  ax.plot(x, rolling("base_em"), color="#9aa3b5", lw=1.6, label="Base model")
251
  ax.plot(x, rolling("c2l_em"), color="#4f5bd5", lw=2.2, label="Code2LoRA (adapter at each commit)")
 
253
  ax.axvline(t + 1, color="#22c3a6", alpha=0.18, lw=1)
254
  ax.set_ylim(0, 100)
255
  ax.set_ylabel("Exact match %\n(rolling)")
256
+ ax.legend(loc="lower right", fontsize=8, frameon=False)
257
  ax.axvline(k + 1, color="#ff6b8b", lw=2)
258
  ax.set_xlim(0.5, max(2, len(cs)) + 0.5)
259
  ax.set_xlabel("Commit")
260
  for s in ("top", "right"):
261
  ax.spines[s].set_visible(False)
 
262
  fig.tight_layout()
263
  return fig
264
 
 
318
 
319
  def default_commit(safe: str) -> int:
320
  d = load_repo(safe)
321
+ if not d["jump_targets"]:
322
+ return len(d["commits"]) - 1
323
+ return d["jump_targets"][-1] if d["live_only"] else d["jump_targets"][0]
324
 
325
 
326
  def on_repo(safe: str):