llama : do a warm-up eval at start for better timings

This commit is contained in:
Georgi Gerganov 2023-06-12 20:56:06 +03:00
parent e4caa8da59
commit 0aed791064
No known key found for this signature in database
GPG key ID: 449E073F9DC10735

View file

@ -331,6 +331,13 @@ int main(int argc, char ** argv) {
std::vector<llama_token> embd;
// do one empty run to warm up the model
{
const std::vector<llama_token> tmp = { llama_token_bos(), };
llama_eval(ctx, tmp.data(), tmp.size(), 0, params.n_threads);
llama_reset_timings(ctx);
}
while ((n_remain != 0 && !is_antiprompt) || params.interactive) {
// predict
if (embd.size() > 0) {