summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorGeorgi Gerganov <ggerganov@gmail.com>2023-09-03 13:42:56 +0300
committerGeorgi Gerganov <ggerganov@gmail.com>2023-09-03 13:43:17 +0300
commit8f429fa5111901f9646cf998643ac5310846d487 (patch)
treedb1ceb2a6696a70eff42487866d1986dc0c6902d /common
parent6519e9c99cffbad19b31bcba86df48c500628c09 (diff)
perplexity : fix ETA by warming up the model with an empty run
Diffstat (limited to 'common')
-rw-r--r--common/common.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/common/common.cpp b/common/common.cpp
index 41fc59ce..a1c3dc78 100644
--- a/common/common.cpp
+++ b/common/common.cpp
@@ -752,6 +752,14 @@ std::tuple<struct llama_model *, struct llama_context *> llama_init_from_gpt_par
params.logit_bias[llama_token_eos(lctx)] = -INFINITY;
}
+ {
+ LOG("warming up the model with an empty run\n");
+
+ const std::vector<llama_token> tmp = { llama_token_bos(lctx), };
+ llama_eval(lctx, tmp.data(), tmp.size(), 0, params.n_threads);
+ llama_reset_timings(lctx);
+ }
+
return std::make_tuple(model, lctx);
}