summaryrefslogtreecommitdiff
path: root/examples/train-text-from-scratch/train-text-from-scratch.cpp
diff options
context:
space:
mode:
authorCebtenzzre <cebtenzzre@gmail.com>2023-09-28 17:41:44 -0400
committerGitHub <noreply@github.com>2023-09-28 17:41:44 -0400
commitbc39553c901a91cfcb757863586250838c83eeab (patch)
tree507d1aedf8ad63e4ed84e37154de9abf31ba358a /examples/train-text-from-scratch/train-text-from-scratch.cpp
parent0ccfc62a96a6b59a8faa14d1b350493f4cd51ae2 (diff)
build : enable more non-default compiler warnings (#3200)
Diffstat (limited to 'examples/train-text-from-scratch/train-text-from-scratch.cpp')
-rw-r--r--examples/train-text-from-scratch/train-text-from-scratch.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/train-text-from-scratch/train-text-from-scratch.cpp b/examples/train-text-from-scratch/train-text-from-scratch.cpp
index a9cf8a38..5043f32d 100644
--- a/examples/train-text-from-scratch/train-text-from-scratch.cpp
+++ b/examples/train-text-from-scratch/train-text-from-scratch.cpp
@@ -483,7 +483,7 @@ static struct ggml_tensor * llama_build_train_graphs(
}
#define GGUF_GET_KEY(ctx, dst, func, type, req, key) \
-{ \
+do { \
const std::string skey(key); \
const int kid = gguf_find_key(ctx, skey.c_str()); \
if (kid >= 0) { \
@@ -495,7 +495,7 @@ static struct ggml_tensor * llama_build_train_graphs(
} else if (req) { \
die_fmt("key not found in model: %s", skey.c_str()); \
} \
-}
+} while (0)
static void load_llama_model_gguf(struct gguf_context * fctx, struct ggml_context * f_ggml_ctx, struct my_llama_model * model) {
// NOTE: gguf_context must be initialized with f_ggml_ctx and no_alloc=false, otherwise tensor data can not be read
@@ -786,7 +786,7 @@ struct train_params {
float rope_freq_scale;
};
-struct train_params get_default_train_params() {
+static struct train_params get_default_train_params() {
struct train_params params;
params.common = get_default_train_params_common();
params.fn_vocab_model = "ggml-vic7b-uncensored-q4_0.bin";