8000 feat: Allow overriding GGUF metadata when loading model by KerfuffleV2 · Pull Request #4092 · ggml-org/llama.cpp · GitHub
[go: up one dir, main page]

Skip to content

feat: Allow overriding GGUF metadata when loading model #4092

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
Dec 5, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix the one time GCC is stricter than clang about something
  • Loading branch information
KerfuffleV2 committed Nov 15, 2023
commit 9d39deab8fea3b3b0a1430768c7903a3170a9bcc
24 changes: 12 additions & 12 deletions llama.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1835,18 +1835,18 @@ struct llama_model_loader {
throw std::runtime_error(format("request for key id %d with unhandled result type: %s", kid, typeid(T).name()));
}

template<> void gk_set(int k, uint8_t & r) { r = gguf_get_val_u8 (ctx_gguf, k); }
template<> void gk_set(int k, uint16_t & r) { r = gguf_get_val_u16 (ctx_gguf, k); }
template<> void gk_set(int k, uint32_t & r) { r = gguf_get_val_u32 (ctx_gguf, k); }
template<> void gk_set(int k, uint64_t & r) { r = gguf_get_val_u64 (ctx_gguf, k); }
template<> void gk_set(int k, int8_t & r) { r = gguf_get_val_i8 (ctx_gguf, k); }
template<> void gk_set(int k, int16_t & r) { r = gguf_get_val_i16 (ctx_gguf, k); }
template<> void gk_set(int k, int32_t & r) { r = gguf_get_val_i32 (ctx_gguf, k); }
template<> void gk_set(int k, int64_t & r) { r = gguf_get_val_i64 (ctx_gguf, k); }
template<> void gk_set(int k, float & r) { r = gguf_get_val_f32 (ctx_gguf, k); }
template<> void gk_set(int k, double & r) { r = gguf_get_val_f64 (ctx_gguf, k); }
template<> void gk_set(int k, bool & r) { r = gguf_get_val_bool(ctx_gguf, k); }
template<> void gk_set(int k, std::string & r) { r = std::string(gguf_get_val_str(ctx_gguf, k)); }
void gk_set(int k, uint8_t & r) { r = gguf_get_val_u8 (ctx_gguf, k); }
void gk_set(int k, uint16_t & r) { r = gguf_get_val_u16 (ctx_gguf, k); }
void gk_set(int k, uint32_t & r) { r = gguf_get_val_u32 (ctx_gguf, k); }
void gk_set(int k, uint64_t & r) { r = gguf_get_val_u64 (ctx_gguf, k); }
void gk_set(int k, int8_t & r) { r = gguf_get_val_i8 (ctx_gguf, k); }
void gk_set(int k, int16_t & r) { r = gguf_get_val_i16 (ctx_gguf, k); }
void gk_set(int k, int32_t & r) { r = gguf_get_val_i32 (ctx_gguf, k); }
void gk_set(int k, int64_t & r) { r = gguf_get_val_i64 (ctx_gguf, k); }
void gk_set(int k, float & r) { r = gguf_get_val_f32 (ctx_gguf, k); }
void gk_set(int k, double & r) { r = gguf_get_val_f64 (ctx_gguf, k); }
void gk_set(int k, bool & r) { r = gguf_get_val_bool(ctx_gguf, k); }
void gk_set(int k, std::string & r) { r = std::string(gguf_get_val_str(ctx_gguf, k)); }

template<typename T>
typename std::enable_if<std::is_integral<T>::value, void>::type
Expand Down
0