mtl : export the LLaMA computation graph

This commit is contained in:
Georgi Gerganov 2023-05-29 20:49:24 +03:00
parent 7552ac5863
commit f85020b19a
No known key found for this signature in database
GPG key ID: 449E073F9DC10735
5 changed files with 71 additions and 10 deletions

View file

@ -0,0 +1,25 @@
#include "common.h"
#include "llama.h"
int main(int argc, char ** argv) {
gpt_params params;
if (!gpt_params_parse(argc, argv, params)) {
return 1;
}
llama_init_backend();
llama_context * ctx = llama_init_from_gpt_params(params);
if (ctx == NULL) {
fprintf(stderr, "%s: error: unable to load model\n", __func__);
return 1;
}
llama_eval_export(ctx, "llama.ggml");
llama_print_timings(ctx);
llama_free(ctx);
return 0;
}