area416 commited on
Commit
91e9968
·
verified ·
1 Parent(s): cee5217

Upload app.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -1063,9 +1063,9 @@ def _invent_secret(seed):
1063
  temperature=0.9, top_p=0.9)
1064
  raw = tokenizer.decode(out[0, ids.shape[1]:], skip_special_tokens=True)
1065
  # strip any stray think wrapper, then take the first non-empty line as the secret
1066
- raw = raw.split("</think>")[-1]
1067
- line = re.split(r"[.\n]", raw.strip(), maxsplit=1)[0]
1068
- return line.strip() or None
1069
 
1070
 
1071
  @spaces.GPU(duration=120)
@@ -1075,7 +1075,7 @@ def run_baseline_xmode(seed, state):
1075
  default — so the player extracts a confession they can't see. Sets the same-seed baseline."""
1076
  state = _fresh_state_xmode()
1077
  # 1) invent + seal the secret (hidden) — robust dedicated generation
1078
- state["secret"] = _invent_secret(seed)
1079
  # 2) stream the untouched interrogation baseline (clean think/spoken split, no SECRET prefill)
1080
  secret = state.get("secret") or ""
1081
  scenario0 = SCENARIO_XMODE + (
 
1063
  temperature=0.9, top_p=0.9)
1064
  raw = tokenizer.decode(out[0, ids.shape[1]:], skip_special_tokens=True)
1065
  # strip any stray think wrapper, then take the first non-empty line as the secret
1066
+ body = raw.split("</think>")[-1]
1067
+ line = re.split(r"[.\n]", body.strip(), maxsplit=1)[0]
1068
+ return (line.strip() or None), raw
1069
 
1070
 
1071
  @spaces.GPU(duration=120)
 
1075
  default — so the player extracts a confession they can't see. Sets the same-seed baseline."""
1076
  state = _fresh_state_xmode()
1077
  # 1) invent + seal the secret (hidden) — robust dedicated generation
1078
+ state["secret"], state["_raw"] = _invent_secret(seed)
1079
  # 2) stream the untouched interrogation baseline (clean think/spoken split, no SECRET prefill)
1080
  secret = state.get("secret") or ""
1081
  scenario0 = SCENARIO_XMODE + (