[pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci
This commit is contained in:
pre-commit-ci[bot] 2026-07-13 10:04:03 +00:00
commit 3fa9fdbc0d
3 changed files with 4 additions and 10 deletions

View file

@ -700,9 +700,7 @@ class SdCppDiffusionBackend:
# Same per-variant encoder selection as _asset_specs, keyed on the loaded repo id, so the
# cache-deletion guard protects the encoder repo this load actually downloaded (the 9B
# variant's Qwen3-8B, not the 4B default).
repos.extend(
terepo for terepo, _f, _k in sd_cpp_text_encoders_for(fam, state.repo_id)
)
repos.extend(terepo for terepo, _f, _k in sd_cpp_text_encoders_for(fam, state.repo_id))
return tuple(dict.fromkeys(r for r in repos if r))
# ── Generate ───────────────────────────────────────────────────────────

View file

@ -108,7 +108,7 @@ def test_discover_tolerates_non_object_and_invalid_utf8_jsonl(tmp_path):
# must be skipped per-line rather than crash the trainer in .get(); a valid row still resolves.
_touch(tmp_path / "x.png")
(tmp_path / "metadata.jsonl").write_text(
"[]\nnull\n\"str\"\n123\n{not json\n"
'[]\nnull\n"str"\n123\n{not json\n'
+ json.dumps({"file_name": "x.png", "text": "hi"})
+ "\n",
encoding = "utf-8",

View file

@ -1045,9 +1045,7 @@ def test_diffusion_info_tolerates_non_object_jsonl(client, dataset_roots):
b"null\n"
b'"just a string"\n'
b"123\n"
b"{not json\n"
+ json.dumps({"file_name": "a.png", "text": "cap a"}).encode("utf-8")
+ b"\n"
b"{not json\n" + json.dumps({"file_name": "a.png", "text": "cap a"}).encode("utf-8") + b"\n"
)
r = client.get("/api/train/diffusion/info")
assert r.status_code == 200, r.text
@ -1082,9 +1080,7 @@ def test_diffusion_dataset_mutations_blocked_while_training_active(client, datas
files = [("files", ("b.png", b"x", "image/png"))],
)
assert up.status_code == 409, up.text
cap = client.put(
"/api/train/diffusion/dataset/locked/caption/a.png", json = {"caption": "hi"}
)
cap = client.put("/api/train/diffusion/dataset/locked/caption/a.png", json = {"caption": "hi"})
assert cap.status_code == 409, cap.text
dele = client.delete("/api/train/diffusion/dataset/locked/image/a.png")
assert dele.status_code == 409, dele.text