| 67 | float scale; |
| 68 | |
| 69 | file_input(std::string & fname, float scale): f_in(fname, std::ios::binary), scale(scale) { |
| 70 | if (!f_in.is_open()) { |
| 71 | throw std::runtime_error("failed to open input gguf from " + fname); |
| 72 | } |
| 73 | |
| 74 | ctx_gguf = load_gguf(fname, &ctx_meta); |
| 75 | alpha = get_kv_f32(ctx_gguf, "adapter.lora.alpha"); |
| 76 | printf("%s: loaded gguf from %s\n", __func__, fname.c_str()); |
| 77 | |
| 78 | for (ggml_tensor * cur = ggml_get_first_tensor(ctx_meta); cur; cur = ggml_get_next_tensor(ctx_meta, cur)) { |
| 79 | std::string name(cur->name); |
| 80 | tensors[name] = cur; |
| 81 | if (g_verbose) { |
| 82 | printf("%s: %s\n", __func__, cur->name); |
| 83 | } |
| 84 | } |
| 85 | } |
| 86 | |
| 87 | ggml_tensor * get_tensor(std::string name) { |
| 88 | if (tensors.find(name) == tensors.end()) { |
nothing calls this directly
no test coverage detected