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

Function format

examples/llava/clip.cpp:25–38  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23#define CLIP_DEBUG
24
25static std::string format(const char * fmt, ...) {
26 va_list ap;
27 va_list ap2;
28 va_start(ap, fmt);
29 va_copy(ap2, ap);
30 int size = vsnprintf(NULL, 0, fmt, ap);
31 GGML_ASSERT(size >= 0 && size < INT_MAX); // NOLINT
32 std::vector<char> buf(size + 1);
33 int size2 = vsnprintf(buf.data(), size + 1, fmt, ap2);
34 GGML_ASSERT(size2 == size);
35 va_end(ap2);
36 va_end(ap);
37 return std::string(buf.data(), buf.size());
38}
39
40//
41// key constants

Callers 4

get_key_idxFunction · 0.70
get_tensorFunction · 0.70
get_ftypeFunction · 0.70
clip_model_loadFunction · 0.70

Calls 3

stringFunction · 0.50
dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected