mirror of
https://github.com/elder-plinius/OBLITERATUS.git
synced 2026-08-18 00:47:23 +02:00
fix: harden quantized checkpoint integration
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user