Skip to content

Commit ce7b187

Browse files
committed
Use LOG instead of printf for raw embedding output
1 parent 883e07a commit ce7b187

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

examples/embedding/embedding.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
#include "llama.h"
55

66
#include <ctime>
7-
#include <cstdio>
87
#include <algorithm>
98

109
#if defined(_MSC_VER)
@@ -85,12 +84,12 @@ static void print_raw_embeddings(const float * emb,
8584
for (int j = 0; j < n_embd_count; ++j) {
8685
for (int i = 0; i < cols; ++i) {
8786
if (embd_normalize == 0) {
88-
printf("%1.0f%s", emb[j * n_embd + i], (i + 1 < cols ? " " : ""));
87+
LOG("%1.0f%s", emb[j * n_embd + i], (i + 1 < cols ? " " : ""));
8988
} else {
90-
printf("%1.7f%s", emb[j * n_embd + i], (i + 1 < cols ? " " : ""));
89+
LOG("%1.7f%s", emb[j * n_embd + i], (i + 1 < cols ? " " : ""));
9190
}
9291
}
93-
printf("\n");
92+
LOG("\n");
9493
}
9594
}
9695

0 commit comments

Comments
 (0)