DedeProGames commited on
Commit
c41ac50
·
verified ·
1 Parent(s): 1575bad

Back to Model: "good move" +value under each board

Browse files
Files changed (1) hide show
  1. render.py +4 -4
render.py CHANGED
@@ -35,7 +35,6 @@ CSS = """
35
  .pmove .act {color:var(--body-text-color); font-variant-numeric:tabular-nums;}
36
  .pmove b {color:var(--body-text-color);}
37
  .pmove .vg {color:#16a34a; font-weight:700;} .pmove .vb {color:#dc2626; font-weight:700;}
38
- .pmove .raw {color:var(--body-text-color); font-family:ui-monospace,SFMono-Regular,Menlo,monospace; font-size:10.5px;}
39
  .results {width:100%; max-width:760px; margin:4px auto 0; border-collapse:collapse !important; font-size:13px; border:none !important;}
40
  .results th, .results td {padding:6px 5px !important; border:none !important; border-bottom:1px solid var(--border-color-primary) !important;
41
  text-align:right; color:var(--body-text-color); font-variant-numeric:tabular-nums; background:transparent !important;}
@@ -84,9 +83,10 @@ def _last_move(game, player):
84
  answer = f"<b>Random:</b> uniform pick{of_n}"
85
  elif pid.startswith("baseline/"):
86
  answer = f"<b>Rules:</b> fixed priorities{of_n}"
87
- elif getattr(game, "last_raw", None) is not None:
88
- raw = game.last_raw.strip()
89
- answer = f'<b>Model:</b> <span class="raw">“{html.escape(raw)}”</span>' if raw else '<b>Model:</b> <i>(no text)</i>'
 
90
  else:
91
  answer = ""
92
  return f'<span class="act">{action}</span><span class="ans">{answer}</span>', html.escape(game.last_description)
 
35
  .pmove .act {color:var(--body-text-color); font-variant-numeric:tabular-nums;}
36
  .pmove b {color:var(--body-text-color);}
37
  .pmove .vg {color:#16a34a; font-weight:700;} .pmove .vb {color:#dc2626; font-weight:700;}
 
38
  .results {width:100%; max-width:760px; margin:4px auto 0; border-collapse:collapse !important; font-size:13px; border:none !important;}
39
  .results th, .results td {padding:6px 5px !important; border:none !important; border-bottom:1px solid var(--border-color-primary) !important;
40
  text-align:right; color:var(--body-text-color); font-variant-numeric:tabular-nums; background:transparent !important;}
 
83
  answer = f"<b>Random:</b> uniform pick{of_n}"
84
  elif pid.startswith("baseline/"):
85
  answer = f"<b>Rules:</b> fixed priorities{of_n}"
86
+ elif game.last_value is not None:
87
+ v = game.last_value
88
+ verdict = "good move" if v > 0 else "bad move"
89
+ answer = f'<b>Model:</b> <span class="{"vg" if v > 0 else "vb"}">“{verdict}”</span> {v:+.2f}{of_n}'
90
  else:
91
  answer = ""
92
  return f'<span class="act">{action}</span><span class="ans">{answer}</span>', html.escape(game.last_description)