Skip to content

Commit 3d31fa6

Browse files
committed
Fix Hunyuan
1 parent 9a85e53 commit 3d31fa6

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

ggml/src/ggml-openvino/ggml-decoder.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,14 +242,17 @@ void GgmlOvDecoder::set_input_output(ggml_tensor* node, bool naive) {
242242
void GgmlOvDecoder::set_llm_params() {
243243
for (int i = 0; i < m_cgraph->n_nodes; i++) {
244244
auto* node = m_cgraph->nodes[i];
245+
std::string name = std::string(node->name);
245246
if (node->op == GGML_OP_VIEW && std::string(node->name) == "cache_k_l0 (view)") {
246247
auto* cache_k = node->src[0];
247248
m_context_size = cache_k->ne[1];
248-
} else if (node->op == GGML_OP_ROPE && std::string(node->name) == "Qcur-0") {
249+
} else if (node->op == GGML_OP_ROPE &&
250+
(name.find("Qcur-0") == 0 || std::string(node->src[0]->name).find("Qcur-0") == 0)) {
249251
m_head_size = node->ne[0];
250252
m_num_heads = node->ne[1];
251253
m_rope_params = node->op_params;
252-
} else if (node->op == GGML_OP_ROPE && std::string(node->name) == "Kcur-0") {
254+
} else if (node->op == GGML_OP_ROPE &&
255+
(name.find("Kcur-0") == 0 || std::string(node->src[0]->name).find("Kcur-0") == 0)) {
253256
m_num_heads_kv = node->ne[1];
254257
}
255258
}

0 commit comments

Comments
 (0)