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

Function split_lines

smallthinker/examples/embedding/embedding.cpp:13–27  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11#endif
12
13static std::vector<std::string> split_lines(const std::string & s, const std::string & separator = "\n") {
14 std::vector<std::string> lines;
15 size_t start = 0;
16 size_t end = s.find(separator);
17
18 while (end != std::string::npos) {
19 lines.push_back(s.substr(start, end - start));
20 start = end + separator.length();
21 end = s.find(separator, start);
22 }
23
24 lines.push_back(s.substr(start)); // Add the last part
25
26 return lines;
27}
28
29static void batch_add_seq(llama_batch & batch, const std::vector<int32_t> & tokens, llama_seq_id seq_id) {
30 size_t n_tokens = tokens.size();

Callers 1

mainFunction · 0.85

Calls 4

findMethod · 0.80
substrMethod · 0.80
lengthMethod · 0.80
push_backMethod · 0.45

Tested by

no test coverage detected