Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 0 additions & 21 deletions extension/llm/runner/llm_runner_helper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,27 +154,6 @@ std::unordered_set<uint64_t> get_eos_ids(
tokenizers::Tokenizer* tokenizer,
Module* module) {
std::unordered_set<uint64_t> eos_ids = {tokenizer->eos_tok()};
// Get EOS IDs if available
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah previously we rely on metadata inside of .pte to determine what eos to use. Partially because some models don't respect the tokenizer's eos. I think we should get rid of this logic to avoid confusion.

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<int64_t>();
eos_ids.emplace(value);
ET_LOG(Info, "eos_id = %" PRId64, value);
}
}
return eos_ids;
}

Expand Down
Loading