Skip to content

Commit d1bfa4d

Browse files
authored
Fix text_llm_runner unit test
Differential Revision: D76791781 Pull Request resolved: #11750
1 parent 3b1c7fd commit d1bfa4d

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

extension/llm/runner/text_llm_runner.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,13 @@ Error TextLLMRunner::generate_from_pos(
128128

129129
// Reduce max_context_len by start_pos
130130
int64_t max_context_len = metadata_.at(kMaxContextLen) - start_pos;
131-
ET_CHECK_MSG(num_prompt_tokens >= 1, "Expected at least 1 prompt token");
132-
ET_CHECK_MSG(
131+
ET_CHECK_OR_RETURN_ERROR(
132+
num_prompt_tokens >= 1,
133+
InvalidArgument,
134+
"Expected at least 1 prompt token");
135+
ET_CHECK_OR_RETURN_ERROR(
133136
num_prompt_tokens < max_context_len,
137+
InvalidArgument,
134138
"num_prompt_tokens %d >= max_context_len %" PRId64
135139
", Max seq length exceeded - please increase max seq len value in your export script",
136140
num_prompt_tokens,

0 commit comments

Comments
 (0)