Skip to content

Commit f9c2155

Browse files
committed
squash! baby-llama : rename llama_layer to baby_llama_layer
Use an unnamed namespace to make identifiers unique to the translation unit.
1 parent c93300f commit f9c2155

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

examples/baby-llama/baby-llama.cpp

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
#pragma warning(disable: 4244 4267) // possible loss of data
1212
#endif
1313

14+
namespace {
15+
1416
#ifdef LLAMA_DEFAULT_RMS_EPS
1517
constexpr float rms_norm_eps = LLAMA_DEFAULT_RMS_EPS;
1618
#else
@@ -105,7 +107,7 @@ struct llama_hparams_lora {
105107
}
106108
};
107109

108-
struct gpt_layer {
110+
struct llama_layer {
109111
// normalization
110112
struct ggml_tensor * attention_norm;
111113

@@ -169,7 +171,7 @@ struct llama_model {
169171
struct ggml_tensor * norm;
170172
struct ggml_tensor * output;
171173

172-
std::vector<gpt_layer> layers;
174+
std::vector<llama_layer> layers;
173175
};
174176

175177
struct llama_model_lora {
@@ -1432,7 +1434,7 @@ static struct ggml_tensor * cross_entropy_loss(
14321434
ggml_new_f32(ctx, eps)))))));
14331435
}
14341436

1435-
int main(int argc, char ** argv) {
1437+
int baby_llama_main(int argc, char ** argv) {
14361438
if (argc < 1) {
14371439
fprintf(stderr, "usage: %s\n", argv[0]);
14381440

@@ -1637,3 +1639,9 @@ int main(int argc, char ** argv) {
16371639

16381640
return 0;
16391641
}
1642+
1643+
}
1644+
1645+
int main(int argc, char ** argv) {
1646+
return baby_llama_main(argc, argv);
1647+
}

0 commit comments

Comments
 (0)