MCPcopy Create free account
hub / github.com/PABannier/sam3.cpp / load_prompt_cases

Function load_prompt_cases

tests/test_phase4.cpp:31–52  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

29}
30
31static std::vector<prompt_case> load_prompt_cases(const std::string & path) {
32 std::vector<prompt_case> cases;
33 std::ifstream f(path);
34 std::string line;
35 while (std::getline(f, line)) {
36 if (line.empty()) {
37 continue;
38 }
39
40 prompt_case pc;
41 size_t tab = line.find('\t');
42 if (tab == std::string::npos) {
43 pc.id = "prompt_" + std::to_string(cases.size());
44 pc.text = line;
45 } else {
46 pc.id = line.substr(0, tab);
47 pc.text = line.substr(tab + 1);
48 }
49 cases.push_back(std::move(pc));
50 }
51 return cases;
52}
53
54static std::string category_for_tensor(const std::string & name) {
55 if (name == "causal_mask") return "causal_mask";

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected