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

Function main

smallthinker/tools/run/run.cpp:1235–1264  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1233}
1234
1235int main(int argc, const char ** argv) {
1236 ctrl_c_handling();
1237 Opt opt;
1238 const int ret = opt.init(argc, argv);
1239 if (ret == 2) {
1240 return 0;
1241 } else if (ret) {
1242 return 1;
1243 }
1244
1245 if (!is_stdin_a_terminal()) {
1246 if (!opt.user.empty()) {
1247 opt.user += "\n\n";
1248 }
1249
1250 opt.user += read_pipe_data();
1251 }
1252
1253 llama_log_set(log_callback, &opt);
1254 LlamaData llama_data;
1255 if (llama_data.init(opt)) {
1256 return 1;
1257 }
1258
1259 if (chat_loop(llama_data, opt)) {
1260 return 1;
1261 }
1262
1263 return 0;
1264}

Callers

nothing calls this directly

Calls 7

ctrl_c_handlingFunction · 0.85
is_stdin_a_terminalFunction · 0.85
read_pipe_dataFunction · 0.85
chat_loopFunction · 0.85
llama_log_setFunction · 0.50
initMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected