fix: handle GPU memory reports and LLM encoding failures (#2020)

This commit is contained in:
leejet authored and GitHub committed 2026-09-22 00:28:52 +08:00
1 parent 97d932b8f8
commit 6dcb5bbd42
4 files changed
+25 -10

No files matched your search

+4 -1
View File
@@ -2219,7 +2219,10 @@ struct LLMEmbedder : public Conditioner {
false,
deepstack_image_embeds,
image_grids);
GGML_ASSERT(!hidden_states.empty());
if (hidden_states.empty()) {
LOG_ERROR("LLM prompt encoding failed");
return {};
}
hidden_states = apply_token_weights(std::move(hidden_states), weights);
GGML_ASSERT(hidden_states.shape()[1] > prompt_template_encode_start_idx);