Skip to content

Commit

Permalink
Tiny cleanup.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 704636988
  • Loading branch information
danielkeysers authored and copybara-github committed Dec 10, 2024
1 parent 331d2cc commit 5bbe814
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions evals/cross_entropy.cc
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,10 @@ HWY_EXPORT(CallSoftmax);
float ComputeCrossEntropy(Gemma& gemma, size_t max_generated_tokens,
const std::vector<int>& prompt, KVCache& kv_cache,
int verbosity) {
const StreamFunc stream_token = [](int /*token*/, float) { return true; };
const StreamFunc stream_token = [](int, float) { return true; };

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

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

0 comments on commit 5bbe814

Please sign in to comment.