Skip to content

Commit 5bbe814

Browse files
danielkeyserscopybara-github
authored andcommitted
Tiny cleanup.
PiperOrigin-RevId: 704636988
1 parent 331d2cc commit 5bbe814

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

evals/cross_entropy.cc

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,11 +100,10 @@ HWY_EXPORT(CallSoftmax);
100100
float ComputeCrossEntropy(Gemma& gemma, size_t max_generated_tokens,
101101
const std::vector<int>& prompt, KVCache& kv_cache,
102102
int verbosity) {
103-
const StreamFunc stream_token = [](int /*token*/, float) { return true; };
103+
const StreamFunc stream_token = [](int, float) { return true; };
104104

105-
// TWeight is unused, but we have to pass it to Config*.
106105
const int vocab_size = gemma.GetModelConfig().vocab_size;
107-
float cross_entropy = std::log(vocab_size); // first token
106+
float cross_entropy = std::log(vocab_size); // first token; == -log(1/v_s)
108107
size_t pos = 1;
109108

110109
const SampleFunc sample_token = [&](float* probs,

0 commit comments

Comments
 (0)