MCPcopy Create free account
hub / github.com/FastFlowLM/FastFlowLM / clear_context

Method clear_context

src/common/AutoModel/automodel.cpp:455–467  ·  view source on GitHub ↗

\brief Clear the context \note The function will clear the context \note The function will reset the total tokens \note The function will reset the last token \note The function will clear the context \note The function will reset the total tokens

Source from the content-addressed store, hash-verified

453/// \note The function will clear the context
454/// \note The function will reset the total tokens
455void AutoModel::clear_context() {
456 this->total_tokens = 0;
457 this->last_token = -1;
458 this->token_history.clear();
459 this->checkpoint_his.clear();
460 this->lm_engine->clear_context();
461 this->total_tokens = 0;
462 this->sampler->reset_penalties();
463 for (size_t i = 0; i < PROFILER_TYPE_NUM; i++) {
464 this->profiler_list[i].reset();
465 }
466 this->last_prefill_time = { 0, "us" };
467}
468
469
470/// \brief Get the current context length

Callers 15

runMethod · 0.80
cmd_clearMethod · 0.80
mainFunction · 0.80
run_benchmarksFunction · 0.80
handle_generateMethod · 0.80
handle_chatMethod · 0.80
load_modelMethod · 0.80
load_modelMethod · 0.80
load_modelMethod · 0.80
load_modelMethod · 0.80

Calls 3

clearMethod · 0.80
reset_penaltiesMethod · 0.80
resetMethod · 0.45

Tested by 1

mainFunction · 0.64