Spaces:
Running on Zero
Running on Zero
chore(fmt): apply ruff format and remove unused import in conftest
Browse files- ace_pipeline.py +1 -0
- app.py +1 -0
- tests/conftest.py +0 -1
- tests/test_ace_pipeline.py +1 -0
- tests/test_theme.py +14 -3
- theme.py +2 -3
ace_pipeline.py
CHANGED
|
@@ -3,6 +3,7 @@
|
|
| 3 |
Mirrors z-image-studio's `models.py` pattern. M0 only implements device
|
| 4 |
detection β the pipeline class itself is filled in at M1.
|
| 5 |
"""
|
|
|
|
| 6 |
from __future__ import annotations
|
| 7 |
|
| 8 |
|
|
|
|
| 3 |
Mirrors z-image-studio's `models.py` pattern. M0 only implements device
|
| 4 |
detection β the pipeline class itself is filled in at M1.
|
| 5 |
"""
|
| 6 |
+
|
| 7 |
from __future__ import annotations
|
| 8 |
|
| 9 |
|
app.py
CHANGED
|
@@ -4,6 +4,7 @@ On HF Spaces, `_bootstrap()` runs once on import to mirror the read-only
|
|
| 4 |
preload cache into a writable tree. On Mac/Linux locally, it's a no-op.
|
| 5 |
The backend singleton is lazy-loaded on first generation request.
|
| 6 |
"""
|
|
|
|
| 7 |
from __future__ import annotations
|
| 8 |
|
| 9 |
import os
|
|
|
|
| 4 |
preload cache into a writable tree. On Mac/Linux locally, it's a no-op.
|
| 5 |
The backend singleton is lazy-loaded on first generation request.
|
| 6 |
"""
|
| 7 |
+
|
| 8 |
from __future__ import annotations
|
| 9 |
|
| 10 |
import os
|
tests/conftest.py
CHANGED
|
@@ -6,7 +6,6 @@ to GPU smoke tests with `pytest -m gpu`.
|
|
| 6 |
|
| 7 |
from __future__ import annotations
|
| 8 |
|
| 9 |
-
import os
|
| 10 |
import sys
|
| 11 |
from pathlib import Path
|
| 12 |
|
|
|
|
| 6 |
|
| 7 |
from __future__ import annotations
|
| 8 |
|
|
|
|
| 9 |
import sys
|
| 10 |
from pathlib import Path
|
| 11 |
|
tests/test_ace_pipeline.py
CHANGED
|
@@ -1,4 +1,5 @@
|
|
| 1 |
"""L1 tests for device autodetect β no torch needed if we mock importlib."""
|
|
|
|
| 2 |
from __future__ import annotations
|
| 3 |
|
| 4 |
import ace_pipeline as ap
|
|
|
|
| 1 |
"""L1 tests for device autodetect β no torch needed if we mock importlib."""
|
| 2 |
+
|
| 3 |
from __future__ import annotations
|
| 4 |
|
| 5 |
import ace_pipeline as ap
|
tests/test_theme.py
CHANGED
|
@@ -1,4 +1,5 @@
|
|
| 1 |
"""L1 theme assertions β palette tokens, CSS presence."""
|
|
|
|
| 2 |
from __future__ import annotations
|
| 3 |
|
| 4 |
import theme
|
|
@@ -9,7 +10,16 @@ def test_palette_tokens_are_brutalist_mono():
|
|
| 9 |
assert theme.INK == "#E5E5E5"
|
| 10 |
assert theme.PRIMARY == "#FFFFFF"
|
| 11 |
# No color accent β that's the whole point of Brutalist Mono
|
| 12 |
-
for v in (
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
assert v.startswith("#")
|
| 14 |
assert len(v) == 7 # all hex, no rgba
|
| 15 |
|
|
@@ -17,12 +27,13 @@ def test_palette_tokens_are_brutalist_mono():
|
|
| 17 |
def test_css_contains_responsive_breakpoints():
|
| 18 |
css = theme.CSS
|
| 19 |
assert "@media" in css
|
| 20 |
-
assert "1024px" in css
|
| 21 |
-
assert "640px" in css
|
| 22 |
|
| 23 |
|
| 24 |
def test_build_theme_returns_gradio_theme():
|
| 25 |
import gradio as gr
|
|
|
|
| 26 |
t = theme.build_theme()
|
| 27 |
# gr.themes.Base is the parent class
|
| 28 |
assert isinstance(t, gr.themes.Base)
|
|
|
|
| 1 |
"""L1 theme assertions β palette tokens, CSS presence."""
|
| 2 |
+
|
| 3 |
from __future__ import annotations
|
| 4 |
|
| 5 |
import theme
|
|
|
|
| 10 |
assert theme.INK == "#E5E5E5"
|
| 11 |
assert theme.PRIMARY == "#FFFFFF"
|
| 12 |
# No color accent β that's the whole point of Brutalist Mono
|
| 13 |
+
for v in (
|
| 14 |
+
theme.BG,
|
| 15 |
+
theme.SURFACE,
|
| 16 |
+
theme.SURFACE_STRONG,
|
| 17 |
+
theme.BORDER,
|
| 18 |
+
theme.BORDER_STRONG,
|
| 19 |
+
theme.INK,
|
| 20 |
+
theme.INK_MUTED,
|
| 21 |
+
theme.PRIMARY,
|
| 22 |
+
):
|
| 23 |
assert v.startswith("#")
|
| 24 |
assert len(v) == 7 # all hex, no rgba
|
| 25 |
|
|
|
|
| 27 |
def test_css_contains_responsive_breakpoints():
|
| 28 |
css = theme.CSS
|
| 29 |
assert "@media" in css
|
| 30 |
+
assert "1024px" in css # tablet breakpoint
|
| 31 |
+
assert "640px" in css # mobile breakpoint
|
| 32 |
|
| 33 |
|
| 34 |
def test_build_theme_returns_gradio_theme():
|
| 35 |
import gradio as gr
|
| 36 |
+
|
| 37 |
t = theme.build_theme()
|
| 38 |
# gr.themes.Base is the parent class
|
| 39 |
assert isinstance(t, gr.themes.Base)
|
theme.py
CHANGED
|
@@ -3,6 +3,7 @@
|
|
| 3 |
Palette tokens are the source of truth; CSS pulls from them. The audio
|
| 4 |
waveform is the only optionally-colored element (rendered white in v1).
|
| 5 |
"""
|
|
|
|
| 6 |
from __future__ import annotations
|
| 7 |
|
| 8 |
import gradio as gr
|
|
@@ -18,9 +19,7 @@ INK_MUTED = "#6B6B6B"
|
|
| 18 |
PRIMARY = "#FFFFFF"
|
| 19 |
ERROR_BG = "#1A1A1A"
|
| 20 |
RADIUS = "6px"
|
| 21 |
-
FONT_STACK =
|
| 22 |
-
'"Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif'
|
| 23 |
-
)
|
| 24 |
|
| 25 |
|
| 26 |
def build_theme() -> gr.themes.Base:
|
|
|
|
| 3 |
Palette tokens are the source of truth; CSS pulls from them. The audio
|
| 4 |
waveform is the only optionally-colored element (rendered white in v1).
|
| 5 |
"""
|
| 6 |
+
|
| 7 |
from __future__ import annotations
|
| 8 |
|
| 9 |
import gradio as gr
|
|
|
|
| 19 |
PRIMARY = "#FFFFFF"
|
| 20 |
ERROR_BG = "#1A1A1A"
|
| 21 |
RADIUS = "6px"
|
| 22 |
+
FONT_STACK = '"Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif'
|
|
|
|
|
|
|
| 23 |
|
| 24 |
|
| 25 |
def build_theme() -> gr.themes.Base:
|