Test Time Coding
decode(system_string: str) -> tuple[Optional[Sequential_Monte_Carlo], Optional[Power_Sampling]]
Decode test-time scaling parameters from a system prompt string.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
system_string
|
str
|
The encoded string containing test-time scaling parameters.
Format: "ITS_ |
required |
Returns:
| Type | Description |
|---|---|
Optional[Sequential_Monte_Carlo]
|
A tuple of (chain_sampling, token_sampling) where each element is either |
Optional[Power_Sampling]
|
a parameter object or None if that sampling technique was not specified. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the format is invalid or parameter values are non-numeric. |
Source code in pita/api/test_time_coding.py
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 | |
encode(chain_sampling: Optional[Sequential_Monte_Carlo] = None, token_sampling: Optional[Power_Sampling] = None) -> str
Encode test-time scaling parameters into a string for embedding in system prompts.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
chain_sampling
|
Optional[Sequential_Monte_Carlo]
|
Chain sampling configuration (SMC). |
None
|
token_sampling
|
Optional[Power_Sampling]
|
Token sampling configuration (Power Sampling). |
None
|
Returns:
| Type | Description |
|---|---|
str
|
A formatted string: "ITS_ |
str
|
Returns empty string if no parameters are provided. |
Source code in pita/api/test_time_coding.py
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 | |