You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: allow configuration of the max soft prompt length (IBM#33)
Instead of defaulting to a hard-coded 256, the default soft prompt
length is now 50% of the max sequence length.
The env var MAX_PROMPT_PREFIX_LENGTH can be used to override this
default if desired
Signed-off-by: Travis Johnson <[email protected]>
Co-authored-by: TRAVIS JOHNSON <[email protected]>
raiseValueError("Invalid value for MAX_PROMPT_PREFIX_LENGTH") fromexc
63
+
64
+
ifmax_prompt_prefix_env_var>max_seq_length-1:
65
+
raiseValueError(f"Value for the MAX_PROMPT_PREFIX_LENGTH ({max_prompt_prefix_env_var}) cannot be larger than the max sequence length - 1 ({max_seq_length-1})")
0 commit comments