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

Function write_file

smallthinker/common/arg.cpp:58–65  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

56}
57
58static void write_file(const std::string & fname, const std::string & content) {
59 std::ofstream file(fname);
60 if (!file) {
61 throw std::runtime_error(string_format("error: failed to open file '%s'\n", fname.c_str()));
62 }
63 file << content;
64 file.close();
65}
66
67common_arg & common_arg::set_examples(std::initializer_list<enum llama_example> examples) {
68 this->examples = std::move(examples);

Callers 2

common_get_hf_fileFunction · 0.70

Calls 3

string_formatFunction · 0.70
c_strMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected