feat: add tqdm progbar to derisk_loopholes generation loop

No progress signal during the 6-mode quadrant (slow Qwen3-4B gen, no bar).
mininterval=maxinterval=120 per token-efficient-logging skill.

Co-Authored-By: Claudypoo <288921227+claudypoo@users.noreply.github.com>
This commit is contained in:
wassname
2026-05-30 10:52:37 +00:00
co-authored by Claudypoo
parent d8874057f3
commit 97f9ca0d09
+3 -1
View File
@@ -34,6 +34,7 @@ from typing import Literal
import torch
import tyro
from loguru import logger
from tqdm import tqdm
from tabulate import tabulate
from transformers import AutoModelForCausalLM, AutoTokenizer, GenerationConfig
@@ -140,7 +141,8 @@ def run_cell(model, tok, problems, gen_cfg, mode: EnvMode, device, cell: str,
hack_samples = [] # (problem_id, faithful_prompt_msgs, hack_completion)
notes = [] # exit-interview feedback (elicit cell only)
dumped = False
for prob in problems:
# ~4-9s/problem (Qwen3-4B, group sampling). Sparse updates keep pueue logs clean.
for prob in tqdm(problems, desc=f"{mode}/{cell}", mininterval=120, maxinterval=120):
prompt = _render(tok, prob["messages"], suffix)
enc = tok(prompt, return_tensors="pt", add_special_tokens=False).to(device)
if enc.input_ids.shape[1] + gen_cfg.max_new_tokens > 2048: