File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -121,6 +121,23 @@ class ET_EXPERIMENTAL IRunner {
121121 std::function<void (const std::string&)> token_callback,
122122 std::function<void(const Stats&)> stats_callback) = 0;
123123
124+ /* *
125+ * Generate text based on the provided prompt and generation config, from a
126+ * given position in KV cache.
127+ *
128+ * @param prompt The input prompt to generate from
129+ * @param start_pos The starting position in KV cache of the input
130+ * @param config Generation configuration parameters
131+ * @param token_callback Callback function called for each generated token
132+ * @param stats_callback Callback function for generation statistics
133+ * @return Error::Ok if successful, an error otherwise
134+ */
135+ virtual runtime::Error generate_from_pos (
136+ const std::string& prompt,
137+ int64_t start_pos,
138+ const GenerationConfig& config,
139+ std::function<void (const std::string&)> token_callback,
140+ std::function<void(const Stats&)> stats_callback) = 0;
124141 /* *
125142 * Stop the generation process.
126143 */
You can’t perform that action at this time.
0 commit comments