| 5 | #include <cstdlib> |
| 6 | |
| 7 | Sampler::Sampler(const std::shared_ptr<Config> config, uint64_t seed) { |
| 8 | vocab_size = config->vocab_size; |
| 9 | std::srand(seed); // TODO: use random_device |
| 10 | } |
| 11 | |
| 12 | float Sampler::sample_prob(int index, const InferenceState& s) { |
| 13 | const float* logits = s.logits(); |
nothing calls this directly
no outgoing calls
no test coverage detected