| 118 | |
| 119 | template <typename Options> |
| 120 | Options restore_batch_ids_in_callback(Options options, const std::vector<size_t>& example_index) { |
| 121 | if (options.callback) { |
| 122 | std::function<bool(GenerationStepResult)> wrapped_callback = |
| 123 | [&example_index, callback = std::move(options.callback)] |
| 124 | (GenerationStepResult step_result) { |
| 125 | step_result.batch_id = example_index[step_result.batch_id]; |
| 126 | return callback(std::move(step_result)); |
| 127 | }; |
| 128 | |
| 129 | options.callback = std::move(wrapped_callback); |
| 130 | } |
| 131 | |
| 132 | return options; |
| 133 | } |
| 134 | |
| 135 | class ResolveEndToken { |
| 136 | private: |
no outgoing calls
no test coverage detected