[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
This commit is contained in:
parent
311d9da637
commit
e6bd256ad6
2 changed files with 13 additions and 5 deletions
|
|
@ -1030,7 +1030,9 @@ class DiffusionBackend:
|
|||
# break the user's bit-exact request (an auto DEFAULT overriding an EXPLICIT
|
||||
# control). Suppress the auto default when speed was explicitly pinned off;
|
||||
# otherwise auto (the dense-capable default) applies.
|
||||
speed_off = speed_mode is not None and str(speed_mode).strip().lower() == SPEED_OFF
|
||||
speed_off = (
|
||||
speed_mode is not None and str(speed_mode).strip().lower() == SPEED_OFF
|
||||
)
|
||||
# "off" normalizes to None (no dense quant), keeping the GGUF-as-is path.
|
||||
transformer_quant = "off" if speed_off else TQ_AUTO
|
||||
|
||||
|
|
|
|||
|
|
@ -2105,7 +2105,15 @@ def test_dense_quant_prefetch_needed_gates(fake_runtime, monkeypatch):
|
|||
|
||||
seen: list = []
|
||||
|
||||
def fake_candidate(*, fam, target, requested, base_repo = None, prequant_path = None, logger = None):
|
||||
def fake_candidate(
|
||||
*,
|
||||
fam,
|
||||
target,
|
||||
requested,
|
||||
base_repo = None,
|
||||
prequant_path = None,
|
||||
logger = None,
|
||||
):
|
||||
seen.append(requested)
|
||||
return object() # a viable dense-quant candidate (scheme resolves AND disk fits)
|
||||
|
||||
|
|
@ -2121,9 +2129,7 @@ def test_dense_quant_prefetch_needed_gates(fake_runtime, monkeypatch):
|
|||
assert backend._dense_quant_prefetch_needed(fam, {"transformer_quant": "none"}) is False
|
||||
# An explicit Speed="off" (bit-exact) load suppresses the dense path -> never widen.
|
||||
assert (
|
||||
backend._dense_quant_prefetch_needed(
|
||||
fam, {"transformer_quant": "fp8", "speed_mode": "off"}
|
||||
)
|
||||
backend._dense_quant_prefetch_needed(fam, {"transformer_quant": "fp8", "speed_mode": "off"})
|
||||
is False
|
||||
)
|
||||
# No viable candidate (unsupported scheme / no disk room / a prequant checkpoint shortcut)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue