| 1233 | } |
| 1234 | |
| 1235 | int 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 | } |
nothing calls this directly
no test coverage detected