@@ -43,6 +43,7 @@ TextLLMRunner::TextLLMRunner(
4343 io_manager_(std::move(io_manager)),
4444 text_token_generator_(std::move(text_token_generator)),
4545 stats_(std::move(stats)),
46+ pos_(0 ),
4647 temperature_(temperature) {
4748 // Note: This constructor assumes that text_prefiller and text_token_generator
4849 // already have references to the Module and TextDecoderRunner they need
@@ -70,9 +71,8 @@ Error TextLLMRunner::load() {
7071 ET_LOG (Info, format, __VA_ARGS__); \
7172 }
7273
73- Error TextLLMRunner::generate_from_pos (
74+ Error TextLLMRunner::generate (
7475 const std::string& prompt,
75- ET_UNUSED int64_t start_pos,
7676 const GenerationConfig& config,
7777 std::function<void (const std::string&)> token_callback,
7878 std::function<void(const Stats&)> stats_callback) {
@@ -217,15 +217,6 @@ Error TextLLMRunner::generate_from_pos(
217217 return Error::Ok;
218218}
219219
220- Error TextLLMRunner::generate (
221- const std::string& prompt,
222- const GenerationConfig& config,
223- std::function<void (const std::string&)> token_callback,
224- std::function<void(const Stats&)> stats_callback) {
225- pos_ = 0 ;
226- return generate_from_pos (prompt, 0 , config, token_callback, stats_callback);
227- }
228-
229220Error TextLLMRunner::warmup (const std::string& prompt, int32_t max_new_tokens) {
230221 // Create a GenerationConfig for warmup
231222 GenerationConfig config{
0 commit comments