mirror of
https://github.com/unslothai/unsloth.git
synced 2026-04-28 03:19:57 +00:00
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
This commit is contained in:
parent
78e2ece54c
commit
5564fe1750
2 changed files with 9 additions and 7 deletions
|
|
@ -65,7 +65,9 @@ class _FakeMod:
|
|||
return iter([])
|
||||
|
||||
|
||||
def test_successful_dispatch_does_not_emit_misleading_warning_when_logger_raises(monkeypatch):
|
||||
def test_successful_dispatch_does_not_emit_misleading_warning_when_logger_raises(
|
||||
monkeypatch,
|
||||
):
|
||||
"""When dispatch_model succeeds but the user's logger.info raises
|
||||
(broken handler / strict test harness), the helper must NOT emit the
|
||||
'Could not attach multi-device dispatch hooks automatically' warning,
|
||||
|
|
|
|||
|
|
@ -60,11 +60,11 @@ def test_seq_class_branch_passes_fast_inference_false():
|
|||
for body_node in if_node.body:
|
||||
hook_calls.extend(_collect_hook_calls_under(body_node))
|
||||
|
||||
assert hook_calls, (
|
||||
"No _attach_bnb_multidevice_hooks call found under `if num_labels is not None:`"
|
||||
)
|
||||
assert (
|
||||
hook_calls
|
||||
), "No _attach_bnb_multidevice_hooks call found under `if num_labels is not None:`"
|
||||
for call in hook_calls:
|
||||
v = _kwarg_literal(call, "fast_inference")
|
||||
assert v is False, (
|
||||
f"seq-class hook call must use fast_inference=False (got {ast.dump(call)})"
|
||||
)
|
||||
assert (
|
||||
v is False
|
||||
), f"seq-class hook call must use fast_inference=False (got {ast.dump(call)})"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue