fix: harden quantized checkpoint integration

This commit is contained in:
Joseph Magly
2026-08-16 12:57:17 -04:00
parent b6a1727cb6
commit b25b3f3b66
13 changed files with 1379 additions and 228 deletions
+13
View File
@@ -80,6 +80,18 @@ def test_refusal_max_tokens_cli_default_and_positive_override(monkeypatch):
assert command.call_args.args[0].refusal_max_tokens == 512
def test_trust_remote_code_requires_explicit_cli_opt_in(monkeypatch):
command = Mock()
monkeypatch.setattr(cli, "_cmd_abliterate", command)
cli.main(["abliterate", "local/model"])
assert command.call_args.args[0].trust_remote_code is False
command.reset_mock()
cli.main(["abliterate", "local/model", "--trust-remote-code"])
assert command.call_args.args[0].trust_remote_code is True
@pytest.mark.parametrize("invalid", ["0", "-1", "not-an-integer"])
def test_refusal_max_tokens_cli_rejects_invalid_values(invalid):
with pytest.raises(SystemExit) as exc:
@@ -510,6 +522,7 @@ def test_abliterate_pipeline_callbacks_residue_and_contribution(monkeypatch, tmp
cli._cmd_abliterate(args)
assert factory.call_args.kwargs["refusal_max_tokens"] == 512
assert factory.call_args.kwargs["gpu_memory_utilization"] == 0.95
assert factory.call_args.kwargs["trust_remote_code"] is False
assert (result_path / "hard_negative_residue.json").is_file()
telemetry.assert_called_once_with(pipeline)