\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
| 453 | /// \note The function will clear the context |
| 454 | /// \note The function will reset the total tokens |
| 455 | void 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 |