mirror of
				https://github.com/ggml-org/llama.cpp.git
				synced 2025-11-03 09:22:01 +00:00 
			
		
		
		
	gguf : do not hardcode tensor names to read
This commit is contained in:
		@@ -335,9 +335,9 @@ bool gguf_ex_read_1(const std::string & fname) {
 | 
			
		||||
        for (int i = 0; i < n_tensors; ++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",
 | 
			
		||||
                    __func__, i, cur->n_dims, cur->name, cur->data);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user