nemo_gym.utils.text
nemo_gym.utils.text
Text helpers for user-facing messages.
Module Contents
Functions
API
Whether Hydra’s override grammar reads text back as exactly expected, type included.
A Did you mean \X`?fragment for the closest candidate tovalue, or ""` if none is close enough.
value as an override value that Hydra parses back to the same value and type.
A string is written as it is when Hydra reads it back unchanged, and as a quoted literal otherwise, so
"1" stays a string and nightly(run) survives the grammar. The check is Hydra’s own parser, not a guess
at its rules. Numbers, booleans, null and lists of those are written in their own syntax; anything else
raises ValueError.
Single-quote value as a literal for Hydra’s override grammar, so it parses back to the same string.
json.dumps is not that encoder: Hydra keeps \uXXXX, \t and a doubled backslash literally, so a Unicode
or backslash-containing filename would reach the command under another name. Hydra un-escapes a backslash
only when its run ends at a quote character, so only those runs (and the quote itself) are escaped here.
Everything else, Unicode included, is passed through unchanged.