odysseus/src/generation_sampling.py
2026-09-17 10:07:40 +00:00

8 lines
287 B
Python

"""Validation shared by direct native generation paths."""
import math
def validate_temperature(value):
if type(value) not in (int, float) or not math.isfinite(value) or value < 0:
raise ValueError('temperature must be a finite nonnegative number')
return float(value)