horde_sdk.generation_parameters.text.object_models¶
FormatImplementationStandard ¶
Bases: StrEnum
The standards for format implementations.
Source code in horde_sdk/generation_parameters/text/object_models.py
KOBOLD_AI
class-attribute
instance-attribute
¶
The KoboldAI standard for a format implementation.
FormatFeatureFlags ¶
Bases: GenerationFeatureFlags
Represents the feature flags for text generation formatting.
Source code in horde_sdk/generation_parameters/text/object_models.py
format_implementation_standard
class-attribute
instance-attribute
¶
format_implementation_standard: (
FormatImplementationStandard | None
) = Field(
default=None,
examples=[FormatImplementationStandard.KOBOLD_AI],
)
The standard for format implementations.
leading_space_to_input_when_missing
class-attribute
instance-attribute
¶
Input formatting option. When enabled, adds a leading space to your input if there is no trailing whitespace at the end of the previous action.
remove_consecutive_newlines
class-attribute
instance-attribute
¶
Output formatting option. When enabled, replaces all occurrences of two or more consecutive newlines in the output with one newline.
remove_special_characters
class-attribute
instance-attribute
¶
Output formatting option. When enabled, removes #/@%}{+=~|\^<> from the output.
remove_end_of_sentence
class-attribute
instance-attribute
¶
Output formatting option. When enabled, removes some characters from the end of the output such that the output doesn't end in the middle of a sentence. If the output is less than one sentence long, does nothing.
remove_after_first_line
class-attribute
instance-attribute
¶
Output formatting option. When enabled, removes everything after the first line of the output, including the newline.
BasicTextGenerationFormatParameters ¶
Bases: GenerationParameterBaseModel
Represent common text generation formatting parameters.
Source code in horde_sdk/generation_parameters/text/object_models.py
frmtadsnsp
class-attribute
instance-attribute
¶
Input formatting option. When enabled, adds a leading space to your input if there is no trailing whitespace at the end of the previous action.
frmtrmblln
class-attribute
instance-attribute
¶
Output formatting option. When enabled, replaces all occurrences of two or more consecutive newlines in the output with one newline.
frmtrmspch
class-attribute
instance-attribute
¶
Output formatting option. When enabled, removes #/@%}{+=~|\^<> from the output.
frmttriminc
class-attribute
instance-attribute
¶
Output formatting option. When enabled, removes some characters from the end of the output such that the output doesn't end in the middle of a sentence. If the output is less than one sentence long, does nothing.
singleline
class-attribute
instance-attribute
¶
Output formatting option. When enabled, removes everything after the first line of the output, including the newline.
BasicTextGenerationParametersTemplate ¶
Bases: GenerationWithModelParameters
Represents the common parameters for a text generation.
Source code in horde_sdk/generation_parameters/text/object_models.py
prompt
class-attribute
instance-attribute
¶
The prompt to use for the generation.
soft_prompt
class-attribute
instance-attribute
¶
The soft prompt to use for the generation.
max_context_length
class-attribute
instance-attribute
¶
Maximum number of tokens to send to the model.
max_length
class-attribute
instance-attribute
¶
Number of tokens to generate.
stop_sequence
class-attribute
instance-attribute
¶
The stop sequences to use for the generation.
temperature
class-attribute
instance-attribute
¶
Temperature value.
dynamic_temp_exponent
class-attribute
instance-attribute
¶
Dynamic temperature exponent value.
dynamic_temp_range
class-attribute
instance-attribute
¶
Dynamic temperature range value.
tfs
class-attribute
instance-attribute
¶
Tail free sampling value.
typical
class-attribute
instance-attribute
¶
Typical sampling value.
sampler_order
class-attribute
instance-attribute
¶
The sampler order to use for the generation.
smoothing_factor
class-attribute
instance-attribute
¶
Quadratic sampling value.
top_a
class-attribute
instance-attribute
¶
Top-a sampling value.
top_k
class-attribute
instance-attribute
¶
Top-k sampling value.
top_p
class-attribute
instance-attribute
¶
Top-p sampling value.
min_p
class-attribute
instance-attribute
¶
Min-p sampling value.
rep_pen
class-attribute
instance-attribute
¶
Base repetition penalty value.
rep_pen_range
class-attribute
instance-attribute
¶
Repetition penalty range.
rep_pen_slope
class-attribute
instance-attribute
¶
Repetition penalty slope.
BasicTextGenerationParameters ¶
Bases: BasicTextGenerationParametersTemplate
Represents the common bare-minimum parameters for a text generation.
Source code in horde_sdk/generation_parameters/text/object_models.py
TextGenerationParametersTemplate ¶
Bases: CompositeParametersBase
Represents the parameters for a text generation.
Source code in horde_sdk/generation_parameters/text/object_models.py
201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 | |
base_params
class-attribute
instance-attribute
¶
The basic text generation parameters for the generation.
format_params
class-attribute
instance-attribute
¶
The text generation formatting parameters.
get_number_expected_results ¶
Return the number of expected results for this parameter set.
Returns:
-
int(int) –The number of expected results.
to_parameters ¶
to_parameters(
*,
base_param_updates: (
BasicTextGenerationParametersTemplate | None
) = None,
result_ids: Sequence[ID_TYPES] | None = None,
allocator: ResultIdAllocator | None = None,
seed: str = "text"
) -> TextGenerationParameters
Convert this template into concrete text generation parameters.
Source code in horde_sdk/generation_parameters/text/object_models.py
TextGenerationParameters ¶
Bases: TextGenerationParametersTemplate
Represents the common bare-minium parameters for a text generation.
Source code in horde_sdk/generation_parameters/text/object_models.py
KoboldAITextGenerationParameters ¶
Bases: TextGenerationParameters
Represents koboldAI text generation parameters.
Source code in horde_sdk/generation_parameters/text/object_models.py
use_default_bad_words_ids
class-attribute
instance-attribute
¶
When True, uses the default KoboldAI bad word IDs.