File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -1023,6 +1023,7 @@ struct llama_model_loader {
1023
1023
int n_kv = 0 ;
1024
1024
int n_tensors = 0 ;
1025
1025
int n_created = 0 ;
1026
+ size_t n_tot_elements = 0 ;
1026
1027
1027
1028
bool use_mmap = false ;
1028
1029
@@ -1047,6 +1048,16 @@ struct llama_model_loader {
1047
1048
1048
1049
file_version = (enum llama_file_version) gguf_get_version (ctx_gguf);
1049
1050
1051
+ for (int i = 0 ; i < n_tensors; i++) {
1052
+ const char * name = gguf_get_tensor_name (ctx_gguf, i);
1053
+ struct ggml_tensor * t = ggml_get_tensor (ctx_meta, name);
1054
+ size_t elem = 1 ;
1055
+ for (int j = 0 ; j < t->n_dims ; j++) {
1056
+ elem *= t->ne [j];
1057
+ }
1058
+ n_tot_elements += elem;
1059
+ }
1060
+
1050
1061
// print meta data
1051
1062
// TODO: make optional
1052
1063
{
@@ -1413,7 +1424,8 @@ static void llama_model_load_internal(
1413
1424
LLAMA_LOG_INFO (" %s: freq_base = %.1f\n " , __func__, hparams.rope_freq_base );
1414
1425
LLAMA_LOG_INFO (" %s: freq_scale = %g\n " , __func__, hparams.rope_freq_scale );
1415
1426
LLAMA_LOG_INFO (" %s: ftype = %u (%s)\n " , __func__, hparams.ftype , llama_ftype_name (hparams.ftype ));
1416
- LLAMA_LOG_INFO (" %s: model size = %s\n " , __func__, llama_model_type_name (model.type ));
1427
+ LLAMA_LOG_INFO (" %s: model size = %.2f B\n " , __func__, ml->n_tot_elements *1e-9 );
1428
+
1417
1429
}
1418
1430
1419
1431
if (vocab_only) {
You can’t perform that action at this time.
0 commit comments