@@ -90,7 +90,6 @@ class TextTokenGenerator {
9090 timestamp_ = std::chrono::high_resolution_clock::now ();
9191
9292 // Generate our tokens
93- rnexecutorch::log (rnexecutorch::LOG_LEVEL ::Info, " kappa generator" , pos, start_pos, max_new_tokens);
9493 while (pos < start_pos + max_new_tokens) {
9594 // Run the model
9695 auto logits_res = text_decoder_runner_->step (tokens_managed, pos);
@@ -101,8 +100,8 @@ class TextTokenGenerator {
101100 prev_token = cur_token;
102101
103102 stats_->on_sampling_begin ();
104- cur_token =
105- text_decoder_runner_-> logits_to_token (logits_tensor, generated_tokens);
103+ cur_token = text_decoder_runner_-> logits_to_token (logits_tensor,
104+ generated_tokens);
106105 stats_->on_sampling_end ();
107106
108107 pos++;
@@ -126,10 +125,6 @@ class TextTokenGenerator {
126125 // history and corrupt the next turn's chat-template rendering
127126 // (e.g. duplicated <end_of_turn>).
128127 if (eos_reached_now) {
129- printf (" \n " );
130- rnexecutorch::log (rnexecutorch::LOG_LEVEL ::Info,
131- " Reached end of generation" );
132- #ifndef RNEX_BYPASS_TOKENIZER
133128 if (!token_cache.empty ()) {
134129 auto flush = tokenizer_->decode (token_cache, false );
135130 if (flush.ok () && !flush.get ().empty () &&
@@ -138,19 +133,11 @@ class TextTokenGenerator {
138133 }
139134 token_cache.clear ();
140135 }
141- #else
142- token_cache.clear ();
143- #endif
144136 break ;
145137 }
146138
147139 token_cache.push_back (static_cast <uint64_t >(cur_token));
148140
149- #ifdef RNEX_BYPASS_TOKENIZER
150- rnexecutorch::log (rnexecutorch::LOG_LEVEL ::Info,
151- " gen_token=" + std::to_string (cur_token));
152- std::string cache_decoded = std::to_string (cur_token) + " " ;
153- #else
154141 // print the token as string, decode it with the Tokenizer object
155142 // We pass false, as we want don't want to skip special tokens e.g.
156143 // <think>
@@ -164,7 +151,6 @@ class TextTokenGenerator {
164151 std::to_string (static_cast <int32_t >(decodeResult.error ())));
165152 }
166153 std::string cache_decoded = decodeResult.get ();
167- #endif
168154 const auto timeIntervalElapsed =
169155 std::chrono::duration_cast<std::chrono::milliseconds>(
170156 std::chrono::high_resolution_clock::now () - timestamp_)
0 commit comments