LMActionConfig
dendron.configs.lm_action_config.LMActionConfig
dataclass
Configuration for LM action nodes (generate_action, loglikelihood_action, and loglikelihood_rolling_action).
Controls LM generation and output processes as well as blackboard interactions.
Args:
input_key (Optional[str]):
The blackboard key used to read the input text that the model will process.
Defaults to "in".
output_key (Optional[str]):
The blackboard key where the model's output will be written.
Defaults to "out".
max_new_tokens (Optional[int]):
Maximum number of tokens to generate in one forward pass.
Defaults to 16.
temperature (Optional[float]):
Sampling temperature for generation. Higher values (e.g., 0.8) make the output
more random, while lower values (e.g., 0.2) make it more deterministic.
Defaults to 0.0 (deterministic).
truncation (Optional[bool]):
Whether to truncate input sequences that exceed the model's maximum length.
Defaults to False.
max_length (Optional[int]):
Maximum allowed length for the combined input and output sequence.
If None, will use the model's default max length. Defaults to None.
prefix_token_id (Optional[int]):
Token ID to be prepended to all inputs. If specified, this token will be
added before the input sequence. Defaults to None.
batch_size (Optional[Union[int, str]]):
Batch size for processing multiple sequences. Use -1 for automatic batching.
Defaults to -1.
max_batch_size (Optional[int]):
Maximum allowed batch size when using automatic batching.
Defaults to 1024.
Source code in src/dendron/configs/lm_action_config.py
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 |
|