MCPcopy Create free account
hub / github.com/appdevforall/CodeOnTheGo / get_rng_seed

Function get_rng_seed

subprojects/llama.cpp/src/llama-sampling.cpp:336–347  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

334}
335
336static uint32_t get_rng_seed(uint32_t seed) {
337 if (seed == LLAMA_DEFAULT_SEED) {
338 // use system clock if std::random_device is not a true RNG
339 static bool is_rd_prng = std::random_device().entropy() == 0;
340 if (is_rd_prng) {
341 return (uint32_t) std::chrono::system_clock::now().time_since_epoch().count();
342 }
343 std::random_device rd;
344 return rd();
345 }
346 return seed;
347}
348
349// llama_sampler API
350

Calls 1

countMethod · 0.45

Tested by

no test coverage detected