mirror of
https://github.com/wassname/evil_MoE.git
synced 2026-07-25 13:10:36 +08:00
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:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user