object_models
FormatImplementationStandard
Bases: StrEnum
The standards for format implementations.
Source code in horde_sdk/generation_parameters/text/object_models.py
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=[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.
model_config
class-attribute
instance-attribute
extra_texts
class-attribute
instance-attribute
Whether there is support for extra texts.
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.
SCHEMA_VERSION
class-attribute
Most recent schema version for this payload.
LEGACY_SCHEMA_VERSION
class-attribute
Oldest schema version supported for deserialization when unspecified.
schema_version
class-attribute
instance-attribute
schema_version: str = Field(
default="",
description="Schema version recorded when the payload was serialized.",
)
model_config
class-attribute
instance-attribute
underlying_generation_scheme
class-attribute
instance-attribute
The underlying method the generation uses to produce results.
- If associated with a auxiliary process that is model based, such as a LoRa, this should be set to
MODEL. - If instead a service is used to produce results, this should be set to
MODEL_FROM_SERVICE. - If there is no generative model involved, and instead a "traditional" algorithm is used, this should be set to
NON_MODEL_ALGORITHM.
Otherwise, if this component is simply a set of parameters that, in itself, does not produce results, this
should be set to None.
current_schema_version
classmethod
legacy_schema_version
classmethod
Return the version assumed for pre-metadata payloads.
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.
SCHEMA_VERSION
class-attribute
Most recent schema version for this payload.
LEGACY_SCHEMA_VERSION
class-attribute
Oldest schema version supported for deserialization when unspecified.
schema_version
class-attribute
instance-attribute
schema_version: str = Field(
default="",
description="Schema version recorded when the payload was serialized.",
)
model_config
class-attribute
instance-attribute
underlying_generation_scheme
class-attribute
instance-attribute
See :attr:ComposedParameterSetBase.underlying_generation_scheme for more information.
current_schema_version
classmethod
legacy_schema_version
classmethod
Return the version assumed for pre-metadata payloads.
BasicTextGenerationParameters
Bases: BasicTextGenerationParametersTemplate
Represents the common bare-minimum parameters for a text generation.
Source code in horde_sdk/generation_parameters/text/object_models.py
model_config
class-attribute
instance-attribute
SCHEMA_VERSION
class-attribute
Most recent schema version for this payload.
LEGACY_SCHEMA_VERSION
class-attribute
Oldest schema version supported for deserialization when unspecified.
schema_version
class-attribute
instance-attribute
schema_version: str = Field(
default="",
description="Schema version recorded when the payload was serialized.",
)
underlying_generation_scheme
class-attribute
instance-attribute
See :attr:ComposedParameterSetBase.underlying_generation_scheme for more information.
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.
current_schema_version
classmethod
legacy_schema_version
classmethod
Return the version assumed for pre-metadata payloads.
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.
SCHEMA_VERSION
class-attribute
Most recent schema version for this payload.
LEGACY_SCHEMA_VERSION
class-attribute
Oldest schema version supported for deserialization when unspecified.
schema_version
class-attribute
instance-attribute
schema_version: str = Field(
default="",
description="Schema version recorded when the payload was serialized.",
)
model_config
class-attribute
instance-attribute
model_config = ConfigDict(
use_attribute_docstrings=True,
from_attributes=True,
arbitrary_types_allowed=True,
)
underlying_generation_scheme
class-attribute
instance-attribute
The underlying method the generation uses to produce results.
Note that this refers only to the top-level generation itself. Component parameters may contain their own
underlying generation schemes. For example, for stable diffusion image generation, this would always be
MODEL even if some of the contained components use another scheme such as MODEL_FROM_SERVICE or
NON_MODEL_ALGORITHM.
- If the top-level generation is model-based, this should be set to
MODEL. - If the top-level generation uses an outside service to produce results, this should be set
to
MODEL_FROM_SERVICE. - If the top-level generation does not use a generative model and instead uses a "traditional" algorithm, this
should be set to
NON_MODEL_ALGORITHM.
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
current_schema_version
classmethod
legacy_schema_version
classmethod
Return the version assumed for pre-metadata payloads.
TextGenerationParameters
Bases: TextGenerationParametersTemplate
Represents the common bare-minium parameters for a text generation.
Source code in horde_sdk/generation_parameters/text/object_models.py
result_ids
instance-attribute
The generation IDs to assign to the resulting discrete generations.
base_params
instance-attribute
The basic text generation parameters for the generation.
SCHEMA_VERSION
class-attribute
Most recent schema version for this payload.
LEGACY_SCHEMA_VERSION
class-attribute
Oldest schema version supported for deserialization when unspecified.
schema_version
class-attribute
instance-attribute
schema_version: str = Field(
default="",
description="Schema version recorded when the payload was serialized.",
)
model_config
class-attribute
instance-attribute
model_config = ConfigDict(
use_attribute_docstrings=True,
from_attributes=True,
arbitrary_types_allowed=True,
)
underlying_generation_scheme
class-attribute
instance-attribute
The underlying method the generation uses to produce results.
Note that this refers only to the top-level generation itself. Component parameters may contain their own
underlying generation schemes. For example, for stable diffusion image generation, this would always be
MODEL even if some of the contained components use another scheme such as MODEL_FROM_SERVICE or
NON_MODEL_ALGORITHM.
- If the top-level generation is model-based, this should be set to
MODEL. - If the top-level generation uses an outside service to produce results, this should be set
to
MODEL_FROM_SERVICE. - If the top-level generation does not use a generative model and instead uses a "traditional" algorithm, this
should be set to
NON_MODEL_ALGORITHM.
format_params
class-attribute
instance-attribute
The text generation formatting parameters.
current_schema_version
classmethod
legacy_schema_version
classmethod
Return the version assumed for pre-metadata payloads.
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
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.
SCHEMA_VERSION
class-attribute
Most recent schema version for this payload.
LEGACY_SCHEMA_VERSION
class-attribute
Oldest schema version supported for deserialization when unspecified.
schema_version
class-attribute
instance-attribute
schema_version: str = Field(
default="",
description="Schema version recorded when the payload was serialized.",
)
model_config
class-attribute
instance-attribute
model_config = ConfigDict(
use_attribute_docstrings=True,
from_attributes=True,
arbitrary_types_allowed=True,
)
underlying_generation_scheme
class-attribute
instance-attribute
The underlying method the generation uses to produce results.
Note that this refers only to the top-level generation itself. Component parameters may contain their own
underlying generation schemes. For example, for stable diffusion image generation, this would always be
MODEL even if some of the contained components use another scheme such as MODEL_FROM_SERVICE or
NON_MODEL_ALGORITHM.
- If the top-level generation is model-based, this should be set to
MODEL. - If the top-level generation uses an outside service to produce results, this should be set
to
MODEL_FROM_SERVICE. - If the top-level generation does not use a generative model and instead uses a "traditional" algorithm, this
should be set to
NON_MODEL_ALGORITHM.
base_params
instance-attribute
The basic text generation parameters for the generation.
format_params
class-attribute
instance-attribute
The text generation formatting parameters.
result_ids
instance-attribute
The generation IDs to assign to the resulting discrete generations.
current_schema_version
classmethod
legacy_schema_version
classmethod
Return the version assumed for pre-metadata payloads.
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.