MCPcopy Create free account
hub / github.com/Luce-Org/lucebox-hub / read_uncounted_i32

Function read_uncounted_i32

server/src/common/daemon_loop.cpp:143–155  ·  view source on GitHub ↗

Read a prompt file: raw int32 stream (file size implies token count).

Source from the content-addressed store, hash-verified

141}
142
143static void emit_generate_error(const GenerateResult & result) {
144 std::fprintf(stderr, "[daemon] generation failed: code=%s",
145 result.error_code().data());
146 if (!result.error_detail().empty()) {
147 std::fprintf(stderr, " detail=%s", result.error_detail().data());
148 }
149 std::fprintf(stderr, "\n");
150 std::printf("err %s\n", result.error_code().data());
151 std::fflush(stdout);
152}
153
154// Read a prompt file: raw int32 stream (file size implies token count).
155static std::vector<int32_t> read_uncounted_i32(const std::string & path) {
156 std::ifstream f(path, std::ios::binary | std::ios::ate);
157 if (!f) return {};
158 const auto sz = (size_t)f.tellg();

Callers 1

run_daemonFunction · 0.85

Calls 3

emptyMethod · 0.45
dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected