]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
llama : merge llama_internal.h into llama.h
authorGeorgi Gerganov <redacted>
Thu, 13 Apr 2023 15:04:45 +0000 (18:04 +0300)
committerGeorgi Gerganov <redacted>
Thu, 13 Apr 2023 15:04:45 +0000 (18:04 +0300)
Hide it behind an #ifdef

CMakeLists.txt
Makefile
examples/quantize-stats/quantize-stats.cpp
llama.cpp
llama.h
llama_internal.h [deleted file]

index affff3ea17e3ee4e11db5314084d85a118639bd7..d5715d92aa8dfbaaf58500a7bf786ac49bcefa42 100644 (file)
@@ -253,7 +253,6 @@ endif()
 add_library(llama
             llama.cpp
             llama.h
-            llama_internal.h
             llama_util.h)
 
 target_include_directories(llama PUBLIC .)
index c7ccf462d335c464a6167d3a24156a2f86d66193..7db2466508d4eb281a63eb6b56f7ea8b336b0e42 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -142,7 +142,7 @@ default: main quantize perplexity embedding
 ggml.o: ggml.c ggml.h
        $(CC)  $(CFLAGS)   -c ggml.c -o ggml.o
 
-llama.o: llama.cpp llama.h llama_util.h llama_internal.h
+llama.o: llama.cpp llama.h llama_util.h
        $(CXX) $(CXXFLAGS) -c llama.cpp -o llama.o
 
 common.o: examples/common.cpp examples/common.h
index 203bfe8cc105748b487e05919391df68822a12d2..c786fe208c78d30368ae791087a030c661982012 100644 (file)
@@ -1,6 +1,7 @@
 #include "ggml.h"
+
+#define LLAMA_API_INTERNAL
 #include "llama.h"
-#include "llama_internal.h"
 
 #include <algorithm>
 #include <cassert>
index 6d8b706b982587893e578c0131f684c816eda0de..c7229568473dd1c7f8c63f3c1a1c59a331833379 100644 (file)
--- a/llama.cpp
+++ b/llama.cpp
@@ -5,7 +5,6 @@
 
 #include "llama_util.h"
 #include "llama.h"
-#include "llama_internal.h"
 
 #include "ggml.h"
 
diff --git a/llama.h b/llama.h
index 7a258a1e16d35127b2f66f90171f8fbbca4821d6..19221759376858f65b3de856d22f795dc2f2620c 100644 (file)
--- a/llama.h
+++ b/llama.h
@@ -179,4 +179,15 @@ extern "C" {
 }
 #endif
 
+// Internal API to be implemented by llama.cpp and used by tests/benchmarks only
+#ifdef LLAMA_API_INTERNAL
+
+#include <vector>
+#include <string>
+struct ggml_tensor;
+
+std::vector<std::pair<std::string, struct ggml_tensor *>>& llama_internal_get_tensor_map(struct llama_context * ctx);
+
+#endif
+
 #endif // LLAMA_H
diff --git a/llama_internal.h b/llama_internal.h
deleted file mode 100644 (file)
index 543eed9..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-// Internal header to be included by llama.cpp and tests/benchmarks only.
-
-#ifndef LLAMA_INTERNAL_H
-#define LLAMA_INTERNAL_H
-
-#include <vector>
-#include <string>
-struct ggml_tensor;
-
-std::vector<std::pair<std::string, struct ggml_tensor *>>& llama_internal_get_tensor_map(struct llama_context * ctx);
-
-#endif // LLAMA_INTERNAL_H