File size: 10,156 Bytes
e89a301 | 1 2 3 4 5 6 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 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 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 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 | [
{
"function_name": "get_scaler",
"file_path": "llmtime.py",
"function_calls": [
{
"function_call_name": "np.isnan",
"functionality": "Check for NaN values in array.",
"input": "history",
"output": "ndarray of bool",
"location_or_namespace": "numpy"
},
{
"function_call_name": "np.quantile",
"functionality": "Compute the quantile of array elements.",
"input": "np.abs(history), alpha",
"output": "float",
"location_or_namespace": "numpy"
},
{
"function_call_name": "np.abs",
"functionality": "Absolute value element-wise.",
"input": "history",
"output": "array_like",
"location_or_namespace": "numpy"
},
{
"function_call_name": "np.maximum",
"functionality": "Element-wise maximum of array elements.",
"input": "np.quantile(np.abs(history), alpha), .01",
"output": "float",
"location_or_namespace": "numpy"
},
{
"function_call_name": "np.min",
"functionality": "Return the minimum along a dimension.",
"input": "history",
"output": "float",
"location_or_namespace": "numpy"
},
{
"function_call_name": "np.max",
"functionality": "Return the maximum along a dimension.",
"input": "history",
"output": "float",
"location_or_namespace": "numpy"
}
]
},
{
"function_name": "truncate_input",
"file_path": "llmtime.py",
"function_calls": [
{
"function_call_name": "split",
"functionality": "Split string on a separator.",
"input": "input_str, settings.time_sep",
"output": "list[str]",
"location_or_namespace": "builtins"
},
{
"function_call_name": "join",
"functionality": "Join list of strings with a separator.",
"input": "settings.time_sep, input_str_chuncks[i:]",
"output": "str",
"location_or_namespace": "builtins"
},
{
"function_call_name": "tokenization_fn",
"functionality": "",
"input": "truncated_input_str",
"output": "list[str]",
"location_or_namespace": "models.llms or internal"
},
{
"function_call_name": "len",
"functionality": "Return number of items in object.",
"input": "input_tokens / input_str_chuncks / input_arr / truncated_input_arr",
"output": "int",
"location_or_namespace": "builtins"
},
{
"function_call_name": "print",
"functionality": "Print warning about truncation.",
"input": "f'Warning: Truncated input from {len(input_arr)} to {len(truncated_input_arr)}'",
"output": "None",
"location_or_namespace": "builtins"
}
]
},
{
"function_name": "handle_prediction",
"file_path": "llmtime.py",
"function_calls": [
{
"function_call_name": "len",
"functionality": "Return length of predicted array.",
"input": "pred",
"output": "int",
"location_or_namespace": "builtins"
},
{
"function_call_name": "print",
"functionality": "Print warning if prediction too short.",
"input": "f'Warning: Prediction too short {len(pred)} < {expected_length}, ...'",
"output": "None",
"location_or_namespace": "builtins"
},
{
"function_call_name": "np.concatenate",
"functionality": "Join two or more arrays.",
"input": "[pred, np.full(expected_length - len(pred), pred[-1])]",
"output": "np.ndarray",
"location_or_namespace": "numpy"
},
{
"function_call_name": "np.full",
"functionality": "Return a new array of given shape and value.",
"input": "expected_length - len(pred), pred[-1]",
"output": "np.ndarray",
"location_or_namespace": "numpy"
}
]
},
{
"function_name": "generate_predictions",
"file_path": "llmtime.py",
"function_calls": [
{
"function_call_name": "len",
"functionality": "Check number of input series.",
"input": "input_strs",
"output": "int",
"location_or_namespace": "builtins"
},
{
"function_call_name": "print",
"functionality": "Print parallel execution info.",
"input": "'Running completions in parallel for each input'",
"output": "None",
"location_or_namespace": "builtins"
},
{
"function_call_name": "min",
"functionality": "Return minimum of arguments.",
"input": "max_concurrent, len(input_strs)",
"output": "int",
"location_or_namespace": "builtins"
},
{
"function_call_name": "ThreadPoolExecutor",
"functionality": "Parallel execution of completions.",
"input": "max_workers",
"output": "ThreadPoolExecutor object",
"location_or_namespace": "concurrent.futures"
},
{
"function_call_name": "tqdm",
"functionality": "Progress bar for parallel execution.",
"input": "p.map(complete, input_strs), total=len(input_strs)",
"output": "iterator",
"location_or_namespace": "tqdm"
},
{
"function_call_name": "map",
"functionality": "Map function over iterable.",
"input": "complete, input_strs",
"output": "iterator",
"location_or_namespace": "concurrent.futures.ThreadPoolExecutor"
},
{
"function_call_name": "deserialize_str",
"functionality": "Deserialize LLM text completion to prediction array.",
"input": "completion, settings, ignore_last=False, steps=steps",
"output": "array-like",
"location_or_namespace": "data.serialize"
},
{
"function_call_name": "handle_prediction",
"functionality": "Post-process prediction output to expected length.",
"input": "deserialize_str(completion, ...), expected_length=steps, strict=strict_handling",
"output": "array-like or None",
"location_or_namespace": "llmtime.py"
}
]
},
{
"function_name": "get_llmtime_predictions_data",
"file_path": "llmtime.py",
"function_calls": [
{
"function_call_name": "assert",
"functionality": "Ensure valid model and input conditions.",
"input": "model in completion_fns",
"output": "None",
"location_or_namespace": "builtins"
},
{
"function_call_name": "isinstance",
"functionality": "Type checks for settings and train/test.",
"input": "settings, dict / train, list / train[i], pd.Series",
"output": "bool",
"location_or_namespace": "builtins"
},
{
"function_call_name": "pd.Series",
"functionality": "Create pandas Series from array.",
"input": "train[i], index=pd.RangeIndex(...)",
"output": "pandas.Series",
"location_or_namespace": "pandas"
},
{
"function_call_name": "pd.RangeIndex",
"functionality": "Create a pandas index.",
"input": "len(train[i]) or len(train[i]), len(test[i])+len(train[i])",
"output": "pandas.RangeIndex",
"location_or_namespace": "pandas"
},
{
"function_call_name": "all",
"functionality": "Check if all elements are True.",
"input": "len(t)==test_len for t in test",
"output": "bool",
"location_or_namespace": "builtins"
},
{
"function_call_name": "len",
"functionality": "Get length of a sequence.",
"input": "train, test, t, preds",
"output": "int",
"location_or_namespace": "builtins"
},
{
"function_call_name": "get_scaler",
"functionality": "Construct Scaler for normalization.",
"input": "train[i].values, alpha=alpha, beta=beta, basic=basic",
"output": "Scaler",
"location_or_namespace": "llmtime.py"
},
{
"function_call_name": "np.array",
"functionality": "Convert list to numpy array.",
"input": "[scaler.transform(input_array) for ...]",
"output": "np.ndarray",
"location_or_namespace": "numpy"
},
{
"function_call_name": "serialize_arr",
"functionality": "Serialize array for model input.",
"input": "scaled_input_arr, settings",
"output": "str",
"location_or_namespace": "data.serialize"
},
{
"function_call_name": "zip",
"functionality": "Iterate over multiple sequences.",
"input": "input_arrs, input_strs",
"output": "iterator",
"location_or_namespace": "builtins"
},
{
"function_call_name": "truncate_input",
"functionality": "Truncate input for context length.",
"input": "input_array, input_str, settings, model, test_len",
"output": "tuple",
"location_or_namespace": "llmtime.py"
},
{
"function_call_name": "generate_predictions",
"functionality": "Run model, deserialize outputs.",
"input": "completion_fn, input_strs, steps, settings, scalers, num_samples, temp, parallel, **kwargs",
"output": "tuple(preds, completions_list, input_strs)",
"location_or_namespace": "llmtime.py"
},
{
"function_call_name": "pd.DataFrame",
"functionality": "Wrap predictions as DataFrame.",
"input": "preds[i], columns=test[i].index",
"output": "pandas.DataFrame",
"location_or_namespace": "pandas"
},
{
"function_call_name": "sample.median",
"functionality": "Column-wise median of predictions.",
"input": "axis=0",
"output": "pandas.Series",
"location_or_namespace": "pandas.DataFrame"
},
{
"function_call_name": "mean",
"functionality": "Compute mean of values.",
"input": "BPDs",
"output": "float",
"location_or_namespace": "numpy"
}
]
}
]
|