Skip to content

Commit

Permalink
Handle num_key_value_heads not present in config
Browse files Browse the repository at this point in the history
  • Loading branch information
TolyaTalamanov committed Dec 10, 2024
1 parent 40497d9 commit cb2b3f6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/cpp/src/llm_pipeline_static.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,8 @@ ModelDesc get_modeldesc_from_json(const std::filesystem::path& filepath) {
if (config_data.contains("_name_or_path")) {
desc.name_or_path = config_data["_name_or_path"].get<std::string>();
}
desc.num_key_value_heads = config_data["num_key_value_heads"].get<int>();
desc.num_key_value_heads = config_data.contains("num_key_value_heads")
? config_data["num_key_value_heads"].get<int>() : -1;
return desc;
}

Expand Down

0 comments on commit cb2b3f6

Please sign in to comment.