Spaces:
Running on Zero
chore: stale comments say what is true now, and three LoRA tests and the test media no longer depend on the machine they run on
Browse files- generate.py: the forward mel transform reads only the audio VAE (true since
7cf1547); the VRAM unit no longer names the deleted host scripts.
- The stale comments the docs review listed in config.py, pipelines.py,
preflight.py, zerogpu.py, tests/verify_streams.py and tests/test_zerogpu.py:
the transformers and bitsandbytes pins, the derived int8 packing peak, the
47.375 GiB partition the untiled decode was proven on, the falsified ~68 GB
ceiling and the pre-pack 82.2 GB disk reading, the MPS remark, stage-2 parts
built on first use, no RAM preflight in preflight.py, blobs that may not be
freed rather than 72 GB that never is, and the retired host.
- The LoRA message-length bounds count the adapter by its file name, not the
temp root's length; the in-use stamp is compared with the clock read just
before the load, not a 60 s wall-clock window.
- tests/conftest.py puts the session's test media, and the seam test's clip
folder, under pytest's base temp, which pytest prunes, instead of leaving a
new folder in the system temp on every run.
- ltx25_studio/config.py +10 -7
- ltx25_studio/generate.py +6 -6
- ltx25_studio/pipelines.py +21 -18
- ltx25_studio/preflight.py +3 -5
- ltx25_studio/zerogpu.py +4 -4
- tests/conftest.py +21 -2
- tests/test_lora_apply.py +3 -1
- tests/test_lora_fetch.py +5 -1
- tests/test_lora_inspect.py +4 -2
- tests/test_ui_generate_seam.py +3 -2
- tests/test_zerogpu.py +1 -1
- tests/verify_streams.py +1 -1
|
@@ -133,10 +133,11 @@ DECODER_CHOICES = ("auto", "diffusion", "conv")
|
|
| 133 |
#: gated, one ``model.safetensors``, **2.490 GB total** -- against **10.279 GB**
|
| 134 |
#: for the bf16 ``google/gemma-4-E2B-it``. Its ``config.json`` carries
|
| 135 |
#: ``quantization_config.quant_method == "gemma"``, which ``transformers``
|
| 136 |
-
#:
|
| 137 |
-
#: ``
|
| 138 |
-
#:
|
| 139 |
-
#:
|
|
|
|
| 140 |
#:
|
| 141 |
#: ⚠️ Its ``config.json`` has **no** ``architectures`` key, so ``AutoModel*``
|
| 142 |
#: cannot dispatch on it. ``enhance.py`` therefore names
|
|
@@ -162,9 +163,11 @@ DEFAULT_PROMPT_ENHANCER_REPO = "google/gemma-4-E2B-it-qat-mobile-transformers"
|
|
| 162 |
#: ⚠️ **Why it is switchable at all: disk.** The prefetch is ~2.5 GB for the QAT
|
| 163 |
#: default, and it lands while ``demo.launch()`` is packing -- the exact window
|
| 164 |
#: ``pipelines.ZEROGPU_DISK_CAP_GB`` is measured against, where the int8 packing
|
| 165 |
-
#: peak
|
| 166 |
-
#: never
|
| 167 |
-
#:
|
|
|
|
|
|
|
| 168 |
DEFAULT_PREFETCH_ENHANCER = True
|
| 169 |
|
| 170 |
|
|
|
|
| 133 |
#: gated, one ``model.safetensors``, **2.490 GB total** -- against **10.279 GB**
|
| 134 |
#: for the bf16 ``google/gemma-4-E2B-it``. Its ``config.json`` carries
|
| 135 |
#: ``quantization_config.quant_method == "gemma"``, which ``transformers``
|
| 136 |
+
#: registers as ``GemmaQuantizer`` from 5.15.1 on; requirements.txt pins 5.23.0,
|
| 137 |
+
#: where ``enhance.py`` reads one per-layer scale back from the checkpoint. The
|
| 138 |
+
#: unpacking layers it installs are plain torch, with no CUDA or kernel
|
| 139 |
+
#: dependency, so the checkpoint runs on either device -- which is what let the
|
| 140 |
+
#: enhancer start on the CPU and what lets it run on the GPU now.
|
| 141 |
#:
|
| 142 |
#: ⚠️ Its ``config.json`` has **no** ``architectures`` key, so ``AutoModel*``
|
| 143 |
#: cannot dispatch on it. ``enhance.py`` therefore names
|
|
|
|
| 163 |
#: ⚠️ **Why it is switchable at all: disk.** The prefetch is ~2.5 GB for the QAT
|
| 164 |
#: default, and it lands while ``demo.launch()`` is packing -- the exact window
|
| 165 |
#: ``pipelines.ZEROGPU_DISK_CAP_GB`` is measured against, where the int8 packing
|
| 166 |
+
#: peak is derived at 121.4-125.4 GB for transformer + text encoder
|
| 167 |
+
#: (``pipelines._quantization_config``; never measured). An operator who knows
|
| 168 |
+
#: this deploy will never enable enhancement can decline to spend that headroom,
|
| 169 |
+
#: and gets the un-prefetched behaviour back: still working, just slower on
|
| 170 |
+
#: first use.
|
| 171 |
DEFAULT_PREFETCH_ENHANCER = True
|
| 172 |
|
| 173 |
|
|
@@ -1287,8 +1287,8 @@ def _prepared_audio(kwargs: dict, request: GenerationRequest, pipe, *, spec):
|
|
| 1287 |
|
| 1288 |
target = getattr(pipe, "pipeline", pipe)
|
| 1289 |
audio_vae = getattr(target, "audio_vae", None)
|
| 1290 |
-
# The
|
| 1291 |
-
#
|
| 1292 |
vocoder = getattr(target, "vocoder", None)
|
| 1293 |
if audio_vae is None:
|
| 1294 |
raise GenerationError(
|
|
@@ -1766,10 +1766,10 @@ def _require_artifact(candidate, *, mode: str, run_dir: Path, track: str = "") -
|
|
| 1766 |
# peak-VRAM instrumentation -- PLAN §7.3
|
| 1767 |
# --------------------------------------------------------------------------
|
| 1768 |
|
| 1769 |
-
#: Every VRAM figure this build prints is a GiB, because that is the unit
|
| 1770 |
-
#: ``
|
| 1771 |
-
#:
|
| 1772 |
-
#:
|
| 1773 |
_GiB = 1024**3
|
| 1774 |
|
| 1775 |
|
|
|
|
| 1287 |
|
| 1288 |
target = getattr(pipe, "pipeline", pipe)
|
| 1289 |
audio_vae = getattr(target, "audio_vae", None)
|
| 1290 |
+
# The forward mel transform reads only the audio VAE (audio.MEL_PARAM_SOURCES,
|
| 1291 |
+
# audio.MEL_CONVENTIONS); the vocoder passed below supplies nothing.
|
| 1292 |
vocoder = getattr(target, "vocoder", None)
|
| 1293 |
if audio_vae is None:
|
| 1294 |
raise GenerationError(
|
|
|
|
| 1766 |
# peak-VRAM instrumentation -- PLAN §7.3
|
| 1767 |
# --------------------------------------------------------------------------
|
| 1768 |
|
| 1769 |
+
#: Every VRAM figure this build prints is a GiB, because that is the unit the
|
| 1770 |
+
#: earlier measurements in ``docs/HINODE_HOST_SETUP.md`` use. A report that
|
| 1771 |
+
#: mixes GB and GiB is a report nobody can line up against the numbers already
|
| 1772 |
+
#: banked.
|
| 1773 |
_GiB = 1024**3
|
| 1774 |
|
| 1775 |
|
|
@@ -160,8 +160,9 @@ def assert_compression_ratios(vae) -> tuple[int, int]:
|
|
| 160 |
# upstream's own dispatch
|
| 161 |
# ---------------------------------------------------------------------------
|
| 162 |
|
| 163 |
-
#: The largest decode PROVEN to fit the
|
| 164 |
-
#:
|
|
|
|
| 165 |
#: died inside ``vae.decode``'s conv3d on the CUDACachingAllocator (~26 GB per
|
| 166 |
#: full-resolution intermediate at 121 frames, on ~35 GB of resident weights).
|
| 167 |
#:
|
|
@@ -482,10 +483,10 @@ def _quantization_config(quantization: str):
|
|
| 482 |
turns into a control.
|
| 483 |
|
| 484 |
**And it is load-bearing now rather than optional.** Disk was never the
|
| 485 |
-
binding constraint — the run died with the disk line reporting **[OK]**
|
| 486 |
-
|
| 487 |
-
against a ceiling
|
| 488 |
-
|
| 489 |
|
| 490 |
✅ **Revised arithmetic**, derived from ``model_files`` component sizes:
|
| 491 |
|
|
@@ -500,7 +501,8 @@ def _quantization_config(quantization: str):
|
|
| 500 |
out of them was blanket.** It was also the bug. Every frame the deployed
|
| 501 |
Space ever produced was correctly-shaped, high-variance garbage — colour
|
| 502 |
static and flat fields, at every resolution, in every mode,
|
| 503 |
-
deterministically.
|
|
|
|
| 504 |
difference in the deployed path is this function, and the config it
|
| 505 |
returned named no ``llm_int8_skip_modules`` at all, so bnb replaced
|
| 506 |
**every** ``nn.Linear`` in the transformer — including the adaLN/modulation
|
|
@@ -549,8 +551,8 @@ def _quantization_config(quantization: str):
|
|
| 549 |
component="transformer",
|
| 550 |
reason=(
|
| 551 |
f"int8 was requested and the quantisation stack is not importable ({exc}). "
|
| 552 |
-
f"`bitsandbytes` is
|
| 553 |
-
f"
|
| 554 |
),
|
| 555 |
) from exc
|
| 556 |
|
|
@@ -589,10 +591,10 @@ def _quantization_config(quantization: str):
|
|
| 589 |
# 3. **`quant_backend` couples us to two libraries' signatures.**
|
| 590 |
# `pipe_quant_config.py:_validate_init_kwargs_in_backends` raises unless
|
| 591 |
# diffusers' and transformers' `BitsAndBytesConfig.__init__` parameter
|
| 592 |
-
# sets are EQUAL. They are identical today,
|
| 593 |
-
#
|
| 594 |
-
#
|
| 595 |
-
#
|
| 596 |
#
|
| 597 |
# ⚠️ The config CLASS differs per component and is not interchangeable. In
|
| 598 |
# the granular branch `_resolve_quant_config` ignores its own `is_diffusers`
|
|
@@ -1454,11 +1456,12 @@ class StageRunner:
|
|
| 1454 |
self.decoder = decoder
|
| 1455 |
#: The generation device; off CUDA the diffusion decoder runs on the CPU.
|
| 1456 |
self.device = device
|
| 1457 |
-
#: Built on
|
| 1458 |
-
#:
|
| 1459 |
-
#:
|
| 1460 |
-
#:
|
| 1461 |
-
#:
|
|
|
|
| 1462 |
self._stage_2_factory = stage_2_factory
|
| 1463 |
#: The diffusion decoder alone, for a single-stage diffusion decode.
|
| 1464 |
self._decoder_factory = decoder_factory
|
|
|
|
| 160 |
# upstream's own dispatch
|
| 161 |
# ---------------------------------------------------------------------------
|
| 162 |
|
| 163 |
+
#: The largest decode PROVEN to fit the 47.375 GiB ``large`` partition untiled
|
| 164 |
+
#: (every run before 2026-08-26 ran there), from live runs: 704x480x49 decoded
|
| 165 |
+
#: clean; 1216x704x121 completed its denoise and then
|
| 166 |
#: died inside ``vae.decode``'s conv3d on the CUDACachingAllocator (~26 GB per
|
| 167 |
#: full-resolution intermediate at 121 frames, on ~35 GB of resident weights).
|
| 168 |
#:
|
|
|
|
| 483 |
turns into a control.
|
| 484 |
|
| 485 |
**And it is load-bearing now rather than optional.** Disk was never the
|
| 486 |
+
binding constraint — the run died with the disk line reporting **[OK]**
|
| 487 |
+
against :data:`ZEROGPU_DISK_CAP_GB` (the 82.2 GB it printed was a pre-pack
|
| 488 |
+
reading), killed at ~60.0 GB of RAM against a ceiling above 93.56 GB (the
|
| 489 |
+
inherited ~68 GB is falsified). See ``docs/SPACE_GENERATION_FINDING.md``.
|
| 490 |
|
| 491 |
✅ **Revised arithmetic**, derived from ``model_files`` component sizes:
|
| 492 |
|
|
|
|
| 501 |
out of them was blanket.** It was also the bug. Every frame the deployed
|
| 502 |
Space ever produced was correctly-shaped, high-variance garbage — colour
|
| 503 |
static and flat fields, at every resolution, in every mode,
|
| 504 |
+
deterministically. Local MPS bf16 artifacts made with tooling outside this
|
| 505 |
+
package (no MPS path existed here then) looked good. The only
|
| 506 |
difference in the deployed path is this function, and the config it
|
| 507 |
returned named no ``llm_int8_skip_modules`` at all, so bnb replaced
|
| 508 |
**every** ``nn.Linear`` in the transformer — including the adaLN/modulation
|
|
|
|
| 551 |
component="transformer",
|
| 552 |
reason=(
|
| 553 |
f"int8 was requested and the quantisation stack is not importable ({exc}). "
|
| 554 |
+
f"`bitsandbytes` is pinned (0.50.2); see requirements.txt for why any pin "
|
| 555 |
+
f"must stay above 0.46.0 rather than the 0.43.3 diffusers itself mandates."
|
| 556 |
),
|
| 557 |
) from exc
|
| 558 |
|
|
|
|
| 591 |
# 3. **`quant_backend` couples us to two libraries' signatures.**
|
| 592 |
# `pipe_quant_config.py:_validate_init_kwargs_in_backends` raises unless
|
| 593 |
# diffusers' and transformers' `BitsAndBytesConfig.__init__` parameter
|
| 594 |
+
# sets are EQUAL. They are identical today, and requirements.txt pins
|
| 595 |
+
# transformers==5.23.0 exactly, but a bump that adds one kwarg on either
|
| 596 |
+
# side would turn int8 into a hard startup failure. The `quant_mapping`
|
| 597 |
+
# path skips that check entirely.
|
| 598 |
#
|
| 599 |
# ⚠️ The config CLASS differs per component and is not interchangeable. In
|
| 600 |
# the granular branch `_resolve_quant_config` ignores its own `is_diffusers`
|
|
|
|
| 1456 |
self.decoder = decoder
|
| 1457 |
#: The generation device; off CUDA the diffusion decoder runs on the CPU.
|
| 1458 |
self.device = device
|
| 1459 |
+
#: Built on first use (a stage-2 request, or a single-stage diffusion
|
| 1460 |
+
#: decode on CUDA), never at construction. The parts are ~2.1 GB of
|
| 1461 |
+
#: weights AND a NATTEN kernel resolved over the network, and a run that
|
| 1462 |
+
#: needs neither never touches them. Building eagerly turned a
|
| 1463 |
+
#: dependency of one branch into a hard requirement for every mode --
|
| 1464 |
+
#: when NATTEN could not resolve, nothing loaded at all.
|
| 1465 |
self._stage_2_factory = stage_2_factory
|
| 1466 |
#: The diffusion decoder alone, for a single-stage diffusion decode.
|
| 1467 |
self._decoder_factory = decoder_factory
|
|
@@ -23,11 +23,9 @@ byte is touched:
|
|
| 23 |
**specifically** -- move the cache out from under that pattern and the 72 GB
|
| 24 |
snapshot is never freed, silently (PLAN §6.2, §8.3).
|
| 25 |
|
| 26 |
-
3. **Resource
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
That turns an anonymous OOM, or a "Workload evicted, storage limit exceeded
|
| 30 |
-
(150G)", into a message that names the fix (PLAN §2.6's quantised fallbacks).
|
| 31 |
|
| 32 |
Stdlib only. A preflight that needs a heavy import to tell you the environment
|
| 33 |
is wrong has already lost.
|
|
|
|
| 23 |
**specifically** -- move the cache out from under that pattern and the 72 GB
|
| 24 |
snapshot is never freed, silently (PLAN §6.2, §8.3).
|
| 25 |
|
| 26 |
+
3. **Resource report.** The startup report (``pipelines.startup_report``) logs
|
| 27 |
+
the disk floor; there is no RAM check here (local runs preflight memory in
|
| 28 |
+
``memory.py``).
|
|
|
|
|
|
|
| 29 |
|
| 30 |
Stdlib only. A preflight that needs a heavy import to tell you the environment
|
| 31 |
is wrong has already lost.
|
|
@@ -207,7 +207,7 @@ def backing_file(address: int, regions) -> str | None:
|
|
| 207 |
def unbacked_parameters(module, regions, *, pattern: str = AUTOPRUNE_PATTERN) -> list[str]:
|
| 208 |
"""Named parameters whose storage is NOT backed by a prunable blob.
|
| 209 |
|
| 210 |
-
|
| 211 |
"""
|
| 212 |
import fnmatch
|
| 213 |
|
|
@@ -260,9 +260,9 @@ def check_mmap_backed(module, *, name: str, maps_text: str | None = None) -> tup
|
|
| 260 |
return True, (
|
| 261 |
f"{len(offenders)} parameters of {name} are not mmap'd from prunable HF blobs: "
|
| 262 |
f"{shown}{more}. ZeroGPU's post-pack cleanup unlinks only file-backed tensors, so "
|
| 263 |
-
f"the
|
| 264 |
-
f"
|
| 265 |
-
f"eagerly loaded
|
| 266 |
)
|
| 267 |
return True, f"mmap backing for {name}: all parameters file-backed and prunable"
|
| 268 |
|
|
|
|
| 207 |
def unbacked_parameters(module, regions, *, pattern: str = AUTOPRUNE_PATTERN) -> list[str]:
|
| 208 |
"""Named parameters whose storage is NOT backed by a prunable blob.
|
| 209 |
|
| 210 |
+
ZeroGPU's post-pack cleanup cannot attribute these to a blob it may unlink.
|
| 211 |
"""
|
| 212 |
import fnmatch
|
| 213 |
|
|
|
|
| 260 |
return True, (
|
| 261 |
f"{len(offenders)} parameters of {name} are not mmap'd from prunable HF blobs: "
|
| 262 |
f"{shown}{more}. ZeroGPU's post-pack cleanup unlinks only file-backed tensors, so "
|
| 263 |
+
f"the blobs behind these may not be freed. int8-quantised weights are materialised "
|
| 264 |
+
f"by construction (the 2026-11-13 boot still freed 65.25 GB); anything else was "
|
| 265 |
+
f"cast, cloned or eagerly loaded, and its dtype must match the checkpoint's."
|
| 266 |
)
|
| 267 |
return True, f"mmap backing for {name}: all parameters file-backed and prunable"
|
| 268 |
|
|
@@ -688,13 +688,32 @@ def audio_input_ready(monkeypatch):
|
|
| 688 |
# --------------------------------------------------------------------------
|
| 689 |
|
| 690 |
_MEDIA_DIR: list[Path] = []
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 691 |
|
| 692 |
|
| 693 |
def _media_dir() -> Path:
|
| 694 |
-
|
| 695 |
|
|
|
|
|
|
|
|
|
|
| 696 |
if not _MEDIA_DIR:
|
| 697 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 698 |
return _MEDIA_DIR[0]
|
| 699 |
|
| 700 |
|
|
|
|
| 688 |
# --------------------------------------------------------------------------
|
| 689 |
|
| 690 |
_MEDIA_DIR: list[Path] = []
|
| 691 |
+
#: The session's pytest config, for its base temp (see :func:`_media_dir`).
|
| 692 |
+
_CONFIG: list = []
|
| 693 |
+
|
| 694 |
+
|
| 695 |
+
def pytest_configure(config):
|
| 696 |
+
_CONFIG.append(config)
|
| 697 |
|
| 698 |
|
| 699 |
def _media_dir() -> Path:
|
| 700 |
+
"""The session's directory for real input files, under pytest's base temp.
|
| 701 |
|
| 702 |
+
pytest keeps only its last few base temps, so these never pile up in the
|
| 703 |
+
system temp folder. Outside pytest, a temp folder removed at exit.
|
| 704 |
+
"""
|
| 705 |
if not _MEDIA_DIR:
|
| 706 |
+
factory = getattr(_CONFIG[-1], "_tmp_path_factory", None) if _CONFIG else None
|
| 707 |
+
if factory is not None:
|
| 708 |
+
_MEDIA_DIR.append(factory.mktemp("ltx25-inputs"))
|
| 709 |
+
else:
|
| 710 |
+
import atexit
|
| 711 |
+
import shutil
|
| 712 |
+
import tempfile
|
| 713 |
+
|
| 714 |
+
path = Path(tempfile.mkdtemp(prefix="ltx25-inputs-"))
|
| 715 |
+
atexit.register(shutil.rmtree, path, ignore_errors=True)
|
| 716 |
+
_MEDIA_DIR.append(path)
|
| 717 |
return _MEDIA_DIR[0]
|
| 718 |
|
| 719 |
|
|
@@ -328,7 +328,9 @@ def test_a_torch_size_mismatch_becomes_a_one_line_dimension_error(good_lora):
|
|
| 328 |
error = excinfo.value
|
| 329 |
assert error.module == "transformer_blocks.0.attn1.to_k"
|
| 330 |
assert (error.expected, error.actual) == (4096, 2048)
|
| 331 |
-
|
|
|
|
|
|
|
| 332 |
assert error.__cause__ is original
|
| 333 |
|
| 334 |
|
|
|
|
| 328 |
error = excinfo.value
|
| 329 |
assert error.module == "transformer_blocks.0.attn1.to_k"
|
| 330 |
assert (error.expected, error.actual) == (4096, 2048)
|
| 331 |
+
# Bounded as a person reads it: the temp root's length is not the message's.
|
| 332 |
+
message = str(error).replace(str(good_lora), good_lora.name)
|
| 333 |
+
assert len(message) < 600, f"{len(message)} characters: {message[:200]}…"
|
| 334 |
assert error.__cause__ is original
|
| 335 |
|
| 336 |
|
|
@@ -712,9 +712,13 @@ def test_loading_an_adapter_marks_it_used_first(tmp_path, fake_pipeline, good_lo
|
|
| 712 |
fetch.mark_used(adapter)
|
| 713 |
_age_stamps(folder, 5000)
|
| 714 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 715 |
lora_apply.apply_lora(fake_pipeline, adapter)
|
| 716 |
|
| 717 |
stamps = [marker.stat().st_mtime for marker in folder.glob(".ltx25-*")]
|
| 718 |
-
assert len(stamps) == 2 and min(stamps) >
|
| 719 |
"a run loading an adapter must stamp it used before the load"
|
| 720 |
)
|
|
|
|
| 712 |
fetch.mark_used(adapter)
|
| 713 |
_age_stamps(folder, 5000)
|
| 714 |
|
| 715 |
+
# Against the clock just before the load, not a wall-clock window: a slow
|
| 716 |
+
# machine must not turn a fresh stamp into an old one. One second of slack
|
| 717 |
+
# for file systems that keep whole seconds.
|
| 718 |
+
before = time.time()
|
| 719 |
lora_apply.apply_lora(fake_pipeline, adapter)
|
| 720 |
|
| 721 |
stamps = [marker.stat().st_mtime for marker in folder.glob(".ltx25-*")]
|
| 722 |
+
assert len(stamps) == 2 and min(stamps) >= before - 1, (
|
| 723 |
"a run loading an adapter must stamp it used before the load"
|
| 724 |
)
|
|
@@ -509,7 +509,9 @@ def test_a_malformed_entry_is_a_format_error_not_a_python_error(header, tmp_path
|
|
| 509 |
lora_inspect.inspect_lora(path)
|
| 510 |
message = str(excinfo.value)
|
| 511 |
assert "malformed.safetensors" in message
|
| 512 |
-
|
|
|
|
|
|
|
| 513 |
|
| 514 |
|
| 515 |
def test_deeply_nested_json_is_a_format_error_not_a_recursion_error(tmp_path):
|
|
@@ -525,7 +527,7 @@ def test_a_hostile_value_is_not_quoted_in_full(tmp_path):
|
|
| 525 |
path = raw_adapter(tmp_path / "long.safetensors", header, b"\x01" * 8)
|
| 526 |
with pytest.raises(LoRAFormatError) as excinfo:
|
| 527 |
lora_inspect.inspect_lora(path)
|
| 528 |
-
assert len(str(excinfo.value)) < 600
|
| 529 |
|
| 530 |
|
| 531 |
@pytest.mark.parametrize("header", MALFORMED_ENTRIES.values(), ids=MALFORMED_ENTRIES)
|
|
|
|
| 509 |
lora_inspect.inspect_lora(path)
|
| 510 |
message = str(excinfo.value)
|
| 511 |
assert "malformed.safetensors" in message
|
| 512 |
+
# Bounded as a person reads it: the temp root's length is not the message's.
|
| 513 |
+
read = message.replace(str(path), path.name)
|
| 514 |
+
assert len(read) < 600, f"a {len(read)}-character message is not one a person reads"
|
| 515 |
|
| 516 |
|
| 517 |
def test_deeply_nested_json_is_a_format_error_not_a_recursion_error(tmp_path):
|
|
|
|
| 527 |
path = raw_adapter(tmp_path / "long.safetensors", header, b"\x01" * 8)
|
| 528 |
with pytest.raises(LoRAFormatError) as excinfo:
|
| 529 |
lora_inspect.inspect_lora(path)
|
| 530 |
+
assert len(str(excinfo.value).replace(str(path), path.name)) < 600
|
| 531 |
|
| 532 |
|
| 533 |
@pytest.mark.parametrize("header", MALFORMED_ENTRIES.values(), ids=MALFORMED_ENTRIES)
|
|
@@ -34,7 +34,7 @@ from functools import lru_cache
|
|
| 34 |
from pathlib import Path
|
| 35 |
|
| 36 |
import pytest
|
| 37 |
-
from conftest import STUB_WAVEFORM, audio_file, inputs_for
|
| 38 |
from test_exports_contract import (
|
| 39 |
MODE_IDS,
|
| 40 |
MODE_TRACK_PAIRS,
|
|
@@ -85,7 +85,8 @@ def conditioning_video() -> str:
|
|
| 85 |
import av
|
| 86 |
import numpy as np
|
| 87 |
|
| 88 |
-
|
|
|
|
| 89 |
path = directory / "conditioning-input.mp4"
|
| 90 |
with av.open(str(path), "w") as container:
|
| 91 |
stream = container.add_stream("h264", rate=24)
|
|
|
|
| 34 |
from pathlib import Path
|
| 35 |
|
| 36 |
import pytest
|
| 37 |
+
from conftest import STUB_WAVEFORM, _media_dir, audio_file, inputs_for
|
| 38 |
from test_exports_contract import (
|
| 39 |
MODE_IDS,
|
| 40 |
MODE_TRACK_PAIRS,
|
|
|
|
| 85 |
import av
|
| 86 |
import numpy as np
|
| 87 |
|
| 88 |
+
# Inside the session's media folder, under pytest's base temp (never left behind).
|
| 89 |
+
directory = Path(tempfile.mkdtemp(prefix="ltx25-seam-", dir=_media_dir()))
|
| 90 |
path = directory / "conditioning-input.mp4"
|
| 91 |
with av.open(str(path), "w") as container:
|
| 92 |
stream = container.add_stream("h264", rate=24)
|
|
@@ -399,7 +399,7 @@ def test_a_space_uses_the_gpu_without_ever_probing_cuda(monkeypatch):
|
|
| 399 |
|
| 400 |
|
| 401 |
def test_a_plain_cuda_box_uses_the_gpu(monkeypatch):
|
| 402 |
-
"""
|
| 403 |
monkeypatch.setattr(zerogpu, "host_has_cuda", _SpiedProbe(True))
|
| 404 |
assert zerogpu.will_use_gpu(zerogpu.local_spaces_stub()) is True
|
| 405 |
|
|
|
|
| 399 |
|
| 400 |
|
| 401 |
def test_a_plain_cuda_box_uses_the_gpu(monkeypatch):
|
| 402 |
+
"""A CUDA machine without the `spaces` package (the retired hinode host was one)."""
|
| 403 |
monkeypatch.setattr(zerogpu, "host_has_cuda", _SpiedProbe(True))
|
| 404 |
assert zerogpu.will_use_gpu(zerogpu.local_spaces_stub()) is True
|
| 405 |
|
|
@@ -7,7 +7,7 @@
|
|
| 7 |
**Do not hardcode a sampling rate.** The vocoder knows its own
|
| 8 |
(``vocoder.config.output_sampling_rate``, 48000 at the pinned revision) and
|
| 9 |
``audio.export_sampling_rate_from()`` is the one place that reads it;
|
| 10 |
-
``scripts/
|
| 11 |
number here would be a second thing to be wrong. Omitting the flag skips the
|
| 12 |
rate check rather than assuming one.
|
| 13 |
|
|
|
|
| 7 |
**Do not hardcode a sampling rate.** The vocoder knows its own
|
| 8 |
(``vocoder.config.output_sampling_rate``, 48000 at the pinned revision) and
|
| 9 |
``audio.export_sampling_rate_from()`` is the one place that reads it;
|
| 10 |
+
``scripts/local_generate.py`` passes the vocoder's value through. A second copy of the
|
| 11 |
number here would be a second thing to be wrong. Omitting the flag skips the
|
| 12 |
rate check rather than assuming one.
|
| 13 |
|