Skip to content

Commit 74aa25b

Browse files
authored
Fix MSVC build: replace ET_UNWRAP with manual error check
Differential Revision: D100218870 Pull Request resolved: #18798
1 parent 16317b4 commit 74aa25b

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

extension/llm/runner/llm_runner_helper.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,11 @@ get_llm_metadata(tokenizers::Tokenizer* tokenizer, Module* module) {
121121
auto& value = pair.second;
122122

123123
if (method_names.count(method_name)) {
124-
value = ET_UNWRAP(module->get(method_name))
125-
.toScalar()
126-
.to<decltype(metadata)::mapped_type>();
124+
auto get_result = module->get(method_name);
125+
if (!get_result.ok()) {
126+
return get_result.error();
127+
}
128+
value = get_result->toScalar().to<decltype(metadata)::mapped_type>();
127129
} else {
128130
ET_LOG(
129131
Info,

0 commit comments

Comments
 (0)