Views
No views yet
hf download ... --local-dir <目标目录>):1hf auth login
2hf download updateattacks/pi-detector-attack-targets --local-dir artifacts/attack_targetsartifacts/attack_targets/
MANIFEST.json
promptsleuth_aug__Completion_Attack/ adapter_config.json
promptsleuth_aug__Context_Tampering/ adapter_model.safetensors
... canary_config.json
browsesafe_clean__multilanguage/ README.mdmistralai/Mistral-7B-v0.1 会在加载时自动从 HF 拉(adapter_config.json 里记着)。--detector_root,各家族的权重自动按 <root>/<dataset>__<family>/ 找:1python -m attack.tap.cli --detector_root artifacts/attack_targets \
2 --dataset promptsleuth_aug --family Instruction_Wrapping ...1from detectors.canary import CanaryDetector
2det = CanaryDetector.from_pretrained(
3 "artifacts/attack_targets/promptsleuth_aug__Instruction_Wrapping", device="cuda")
4det.detect(text) # 1 = 判成攻击,0 = 判成干净(= 攻击绕过成功)mistralai/Mistral-7B-v0.1)。
训练配方:--init_from scratch,3 轮 × 500 步的 canary minimax 课程,agent 增强、k=1、n_gen=63。MANIFEST.json。canary_config.json 不能删 —— 里面是训练时约定的 separator,推理格式必须与训练一致,
缺了会静默退回默认值并让误报率飙升(干净样本命中率从 40/40 掉到 13/40)。<dataset>__<family> 是 --detector_root 的查找约定,别改名。