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

Function format_partial_response

examples/server/server.cpp:2200–2217  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2198}
2199
2200static json format_partial_response(
2201 llama_server_context &llama, llama_client_slot *slot, const std::string &content, const std::vector<completion_token_output> &probs
2202) {
2203 json res = json
2204 {
2205 {"content", content },
2206 {"stop", false},
2207 {"slot_id", slot->id },
2208 {"multimodal", llama.multimodal }
2209 };
2210
2211 if (slot->sparams.n_probs > 0)
2212 {
2213 res["completion_probabilities"] = probs_vector_to_json(llama.ctx, probs);
2214 }
2215
2216 return res;
2217}
2218
2219static json format_tokenizer_response(const std::vector<llama_token> &tokens)
2220{

Callers

nothing calls this directly

Calls 1

probs_vector_to_jsonFunction · 0.85

Tested by

no test coverage detected