[Misc] Improve error messages for unsupported types and parameters (#30593)

Signed-off-by: BlankR <hjyblanche@gmail.com>
Co-authored-by: Wentao Ye <44945378+yewentao256@users.noreply.github.com>
This commit is contained in:
BlankR
2026-01-07 09:00:16 +00:00
committed by GitHub
co-authored by Wentao Ye
parent 1f33e38e81
commit 0790f07695
11 changed files with 40 additions and 16 deletions
+5 -1
View File
@@ -599,7 +599,11 @@ def smart_resize(
w_bar = ceil_by_factor(width * beta, factor)
if min_pixels > h_bar * w_bar or h_bar * w_bar > max_pixels:
raise ValueError(f"encounter invalid h_bar: {h_bar}, w_bar: {w_bar}")
raise ValueError(
f"Invalid h_bar={h_bar}, w_bar={w_bar}: "
f"h_bar * w_bar must be >= min_pixels ({min_pixels}) "
f"and <= max_pixels ({max_pixels})."
)
return h_bar, w_bar