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

Method reset

examples/server/server.cpp:400–425  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

398 double t_token_generation; // ms
399
400 void reset() {
401 num_prompt_tokens = 0;
402 generated_text = "";
403 truncated = false;
404 stopped_eos = false;
405 stopped_word = false;
406 stopped_limit = false;
407 stopping_word = "";
408 multibyte_pending = 0;
409 n_past = 0;
410 sent_count = 0;
411 sent_token_probs_index = 0;
412 infill = false;
413
414 generated_token_probs.clear();
415
416 for (slot_image &img : images)
417 {
418 free(img.image_embedding);
419 delete[] img.img_data.data;
420 img.prefix_prompt = "";
421 }
422
423 images.clear();
424 // llama_set_rng_seed(ctx, params.seed); in batched the seed matter???????
425 }
426
427 bool has_budget(gpt_params &global_params) {
428 n_remaining = -1;

Callers 8

load_all_dataMethod · 0.45
mainFunction · 0.45
initializeMethod · 0.45
process_tasksMethod · 0.45

Calls 1

clearMethod · 0.45

Tested by

no test coverage detected