mirror of
https://github.com/ggerganov/llama.cpp.git
synced 2025-01-08 11:46:53 +01:00
gguf : do not hardcode tensor names to read
This commit is contained in:
parent
9475cdb7a3
commit
08dc8fd884
@ -335,9 +335,9 @@ bool gguf_ex_read_1(const std::string & fname) {
|
|||||||
for (int i = 0; i < n_tensors; ++i) {
|
for (int i = 0; i < n_tensors; ++i) {
|
||||||
fprintf(stdout, "%s: reading tensor %d data\n", __func__, i);
|
fprintf(stdout, "%s: reading tensor %d data\n", __func__, i);
|
||||||
|
|
||||||
const std::string name = "tensor_" + to_string(i);
|
const char * name = gguf_get_tensor_name(ctx, i);
|
||||||
|
|
||||||
struct ggml_tensor * cur = ggml_get_tensor(ctx_data, name.c_str());
|
struct ggml_tensor * cur = ggml_get_tensor(ctx_data, name);
|
||||||
|
|
||||||
fprintf(stdout, "%s: tensor[%d]: n_dims = %d, name = %s, data = %p\n",
|
fprintf(stdout, "%s: tensor[%d]: n_dims = %d, name = %s, data = %p\n",
|
||||||
__func__, i, cur->n_dims, cur->name, cur->data);
|
__func__, i, cur->n_dims, cur->name, cur->data);
|
||||||
|
Loading…
Reference in New Issue
Block a user