gguf : init

This commit is contained in:
Georgi Gerganov 2023-07-26 11:16:07 +03:00
parent 5488fb789e
commit 4d698495ea
No known key found for this signature in database
GPG key ID: 449E073F9DC10735
4 changed files with 64 additions and 3 deletions

34
examples/gguf/gguf.cpp Normal file
View file

@ -0,0 +1,34 @@
#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;
}