gguf : init
This commit is contained in:
parent
5488fb789e
commit
4d698495ea
4 changed files with 64 additions and 3 deletions
34
examples/gguf/gguf.cpp
Normal file
34
examples/gguf/gguf.cpp
Normal 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;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue