fix(surgery): guard unvalidated Qwen hybrid layouts

This commit is contained in:
Joseph Magly
2026-08-24 13:54:31 -04:00
parent 56442df2d2
commit ccba4f5d85
9 changed files with 399 additions and 14 deletions
+17
View File
@@ -80,6 +80,23 @@ def test_refusal_max_tokens_cli_default_and_positive_override(monkeypatch):
assert command.call_args.args[0].refusal_max_tokens == 512
def test_quality_guardrail_cli_overrides(monkeypatch):
command = Mock()
monkeypatch.setattr(cli, "_cmd_abliterate", command)
cli.main([
"abliterate", "local/model",
"--max-perplexity-increase", "2.5",
"--min-coherence-retention", "0.75",
"--max-degenerate-fraction", "0.1",
])
args = command.call_args.args[0]
assert args.max_perplexity_increase == 2.5
assert args.min_coherence_retention == 0.75
assert args.max_degenerate_fraction == 0.1
def test_trust_remote_code_requires_explicit_cli_opt_in(monkeypatch):
command = Mock()
monkeypatch.setattr(cli, "_cmd_abliterate", command)