| 228 | } |
| 229 | |
| 230 | int main(int argc, char ** argv) { |
| 231 | if (argc < 3) { |
| 232 | printf("usage: %s data.gguf r|w\n", argv[0]); |
| 233 | return -1; |
| 234 | } |
| 235 | |
| 236 | const std::string fname(argv[1]); |
| 237 | const std::string mode (argv[2]); |
| 238 | |
| 239 | GGML_ASSERT((mode == "r" || mode == "w") && "mode must be r or w"); |
| 240 | |
| 241 | if (mode == "w") { |
| 242 | GGML_ASSERT(gguf_ex_write(fname) && "failed to write gguf file"); |
| 243 | } else if (mode == "r") { |
| 244 | GGML_ASSERT(gguf_ex_read_0(fname) && "failed to read gguf file"); |
| 245 | GGML_ASSERT(gguf_ex_read_1(fname) && "failed to read gguf file"); |
| 246 | } |
| 247 | |
| 248 | return 0; |
| 249 | } |
nothing calls this directly
no test coverage detected