MCPcopy Create free account
hub / github.com/Tiiny-AI/PowerInfer / reset

Method reset

smallthinker/tools/server/server.cpp:1307–1331  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1305 int32_t n_draft_accepted = 0; // Draft tokens actually accepted
1306
1307 void reset() {
1308 SLT_DBG(*this, "%s", "\n");
1309
1310 n_prompt_tokens = 0;
1311 last_nl_pos = 0;
1312 generated_text = "";
1313 has_new_line = false;
1314 truncated = false;
1315 stop = STOP_TYPE_NONE;
1316 stopping_word = "";
1317 n_past = 0;
1318 n_sent_text = 0;
1319 task_type = SERVER_TASK_TYPE_COMPLETION;
1320 chat_format = COMMON_CHAT_FORMAT_CONTENT_ONLY;
1321
1322 generated_tokens.clear();
1323 generated_token_probs.clear();
1324 chat_msg = {};
1325 json_schema = json();
1326 generated_tool_call_ids.clear();
1327
1328 // clear speculative decoding stats
1329 n_draft_total = 0;
1330 n_draft_accepted = 0;
1331 }
1332
1333 bool is_non_causal() const {
1334 return task_type == SERVER_TASK_TYPE_EMBEDDING || task_type == SERVER_TASK_TYPE_RERANK;

Callers 12

init_vision_contextMethod · 0.45
clip_ctxMethod · 0.45
clip_graphMethod · 0.45
clip_model_loaderMethod · 0.45
load_tensorsMethod · 0.45
bitmapMethod · 0.45
load_modelMethod · 0.45
initMethod · 0.45
launch_slot_with_taskMethod · 0.45
mainFunction · 0.45
common_init_from_paramsFunction · 0.45

Calls 1

clearMethod · 0.45

Tested by

no test coverage detected