Skip to content

Commit b706d68

Browse files
authored
fix: restore singleton dims for LLM outputs (#1518)
1 parent b758b7d commit b706d68

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/llm.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1403,7 +1403,8 @@ namespace LLM {
14031403
out_layers,
14041404
return_all_hidden_states);
14051405
};
1406-
return take_or_empty(GGMLRunner::compute<float>(get_graph, n_threads, true));
1406+
return restore_trailing_singleton_dims(GGMLRunner::compute<float>(get_graph, n_threads, true),
1407+
input_ids.dim() + 1);
14071408
}
14081409

14091410
int64_t get_num_image_tokens(int64_t t, int64_t h, int64_t w) {

0 commit comments

Comments
 (0)