llama.cpp/examples/gguf/gguf.cpp
Georgi Gerganov 4d698495ea
gguf : init
2023-07-26 18:21:12 +03:00

35 lines
697 B
C++

#include "ggml.h"
#include <cstdio>
#include <string>
bool gguf_write(const std::string & fname) {
return true;
}
bool gguf_read(const std::string & fname) {
return true;
}
int main(int argc, char ** argv) {
if (argc < 3) {
fprintf(stdout, "usage: %s data.gguf r|w\n", argv[0]);
return -1;
}
const std::string fname(argv[1]);
const std::string mode(argv[2]);
GGML_ASSERT((mode == "r" || mode == "w") && "mode must be r or w");
if (mode == "w") {
GGML_ASSERT(gguf_write(fname) && "failed to write gguf file");
} else if (mode == "r") {
GGML_ASSERT(gguf_read(fname) && "failed to read gguf file");
}
return 0;
}