From cbe4ba63fc7084d78cb2e7d2cf32881fc7314c75 Mon Sep 17 00:00:00 2001 From: Lucy Qiu Date: Thu, 16 Oct 2025 18:12:42 -0700 Subject: [PATCH] Use tokenizer eos Summary: Currently we check the tokenizer eos, and then override it with method eos. Sounds like this was for legacy cases where tokenizer did not store eos. Use tokenizer eos as source of truth. Differential Revision: D84865804 --- extension/llm/runner/llm_runner_helper.cpp | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/extension/llm/runner/llm_runner_helper.cpp b/extension/llm/runner/llm_runner_helper.cpp index d1e4ff2ce45..cd520ec5d42 100644 --- a/extension/llm/runner/llm_runner_helper.cpp +++ b/extension/llm/runner/llm_runner_helper.cpp @@ -154,27 +154,6 @@ std::unordered_set get_eos_ids( tokenizers::Tokenizer* tokenizer, Module* module) { std::unordered_set eos_ids = {tokenizer->eos_tok()}; - // Get EOS IDs if available - auto method_names_result = module->method_names(); - if (method_names_result.error() != Error::Ok) { - ET_LOG(Error, "Failed reading method names"); - return eos_ids; - } - const auto& method_names = method_names_result.get(); - - if (method_names.count(llm::kEosIds)) { - eos_ids.clear(); - auto execute_result = module->execute(llm::kEosIds); - if (execute_result.error() != Error::Ok) { - ET_LOG(Error, "Failed to execute %s", llm::kEosIds); - return eos_ids; - } - for (const auto& eos_id : execute_result.get()) { - auto value = eos_id.toScalar().to(); - eos_ids.emplace(value); - ET_LOG(Info, "eos_id = %" PRId64, value); - } - } return eos_ids; }