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

Function format

smallthinker/src/llama-impl.cpp:82–95  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

80}
81
82std::string format(const char * fmt, ...) {
83 va_list ap;
84 va_list ap2;
85 va_start(ap, fmt);
86 va_copy(ap2, ap);
87 int size = vsnprintf(NULL, 0, fmt, ap);
88 GGML_ASSERT(size >= 0 && size < INT_MAX); // NOLINT
89 std::vector<char> buf(size + 1);
90 int size2 = vsnprintf(buf.data(), size + 1, fmt, ap2);
91 GGML_ASSERT(size2 == size);
92 va_end(ap2);
93 va_end(ap);
94 return std::string(buf.data(), size);
95}
96
97std::string llama_format_tensor_shape(const std::vector<int64_t> & ne) {
98 char buf[256];

Callers 15

llama_tensor_weightMethod · 0.70
weight_buft_supportedFunction · 0.70
make_cpu_buft_listFunction · 0.70
make_gpu_buft_listFunction · 0.70
load_hparamsMethod · 0.70
load_tensorsMethod · 0.70
buft_supportedFunction · 0.70
select_buftFunction · 0.70
llama_contextMethod · 0.70
get_logits_ithMethod · 0.70
get_embeddings_ithMethod · 0.70
state_read_dataMethod · 0.70

Calls 2

stringClass · 0.50
dataMethod · 0.45

Tested by

no test coverage detected