Harden formatter preset normalization
This commit is contained in:
@@ -3039,6 +3039,10 @@ def smoke_caption_policy() -> None:
|
||||
)
|
||||
_expect(caption_policy.normalize_detail_level("bad") == "balanced", "Caption invalid detail fallback changed")
|
||||
_expect(caption_policy.normalize_style_policy("bad") == "drop_style_tail", "Caption invalid style fallback changed")
|
||||
_expect(
|
||||
caption_policy.normalize_style_policy("Keep Style Terms") == "keep_style_terms",
|
||||
"Caption style policy should normalize spaces/case",
|
||||
)
|
||||
_expect(caption_policy.style_policy_choices() == ["drop_style_tail", "keep_style_terms"], "Caption style policy choices changed")
|
||||
_expect(caption_policy.keep_style_terms("keep_style_terms") is True, "Caption style policy keep flag changed")
|
||||
_expect(caption_policy.detail_allows("concise") is False, "Caption concise detail gate changed")
|
||||
@@ -3048,6 +3052,10 @@ def smoke_caption_policy() -> None:
|
||||
caption_policy.normalize_caption_profile("bad") == caption_policy.CAPTION_PROFILE_DEFAULT,
|
||||
"Caption invalid profile fallback changed",
|
||||
)
|
||||
_expect(
|
||||
caption_policy.normalize_caption_profile("training-dense") == "training_dense",
|
||||
"Caption profile should normalize hyphen spelling",
|
||||
)
|
||||
_expect(
|
||||
caption_policy.apply_caption_profile(
|
||||
"training_dense",
|
||||
@@ -3381,8 +3389,11 @@ def smoke_sdxl_presets_policy() -> None:
|
||||
sdxl_presets.normalize_formatter_profile("bad") == sdxl_presets.DEFAULT_FORMATTER_PROFILE,
|
||||
"SDXL invalid profile fallback changed",
|
||||
)
|
||||
_expect(sdxl_presets.normalize_formatter_profile("SDXL Photo") == "sdxl_photo", "SDXL profile should normalize spaces/case")
|
||||
_expect(sdxl_presets.normalize_style_preset("bad") == sdxl_presets.DEFAULT_STYLE_PRESET, "SDXL invalid style fallback changed")
|
||||
_expect(sdxl_presets.normalize_style_preset("flat-vector-pony") == "flat_vector_pony", "SDXL style should normalize hyphens")
|
||||
_expect(sdxl_presets.normalize_quality_preset("bad") == sdxl_presets.DEFAULT_QUALITY_PRESET, "SDXL invalid quality fallback changed")
|
||||
_expect(sdxl_presets.normalize_quality_preset("Pony High") == "pony_high", "SDXL quality should normalize spaces/case")
|
||||
_expect(
|
||||
sdxl_presets.apply_formatter_profile(
|
||||
"sdxl_photo",
|
||||
|
||||
Reference in New Issue
Block a user