From 4b96c69a08a0e0e6f09883f7d8bad1375fbcaf86 Mon Sep 17 00:00:00 2001 From: Xuan Son Nguyen Date: Sat, 7 Sep 2024 19:20:56 +0200 Subject: [PATCH] export-docs --> gen-docs --- Makefile | 6 +++--- common/common.cpp | 2 +- common/common.h | 2 -- examples/{export-docs => gen-docs}/CMakeLists.txt | 4 ++-- .../{export-docs/export-docs.cpp => gen-docs/gen-docs.cpp} | 4 ---- 5 files changed, 6 insertions(+), 12 deletions(-) rename examples/{export-docs => gen-docs}/CMakeLists.txt (70%) rename examples/{export-docs/export-docs.cpp => gen-docs/gen-docs.cpp} (95%) diff --git a/Makefile b/Makefile index 8b8605d55..6053bc17b 100644 --- a/Makefile +++ b/Makefile @@ -39,7 +39,7 @@ BUILD_TARGETS = \ llama-tokenize \ llama-vdot \ llama-cvector-generator \ - llama-export-docs \ + llama-gen-docs \ tests/test-c.o # Binaries only useful for tests @@ -1444,11 +1444,11 @@ examples/server/%.hpp: examples/server/public/% Makefile echo "unsigned int $${NAME}_len = $(shell cat $< | wc -c );" \ ) > $@ -llama-export-docs: examples/export-docs/export-docs.cpp \ +llama-gen-docs: examples/gen-docs/gen-docs.cpp \ $(OBJ_ALL) $(CXX) $(CXXFLAGS) -c $< -o $(call GET_OBJ_FILE, $<) $(CXX) $(CXXFLAGS) $(filter-out %.h $<,$^) $(call GET_OBJ_FILE, $<) -o $@ $(LDFLAGS) - ./llama-export-docs + ./llama-gen-docs libllava.a: examples/llava/llava.cpp \ examples/llava/llava.h \ diff --git a/common/common.cpp b/common/common.cpp index 3b70fd53b..e92dee7a7 100644 --- a/common/common.cpp +++ b/common/common.cpp @@ -298,7 +298,7 @@ static std::string format(const char * fmt, ...) { return std::string(buf.data(), size); } -void gpt_params_handle_model_default(gpt_params & params) { +static void gpt_params_handle_model_default(gpt_params & params) { if (!params.hf_repo.empty()) { // short-hand to avoid specifying --hf-file -> default it to --model if (params.hf_file.empty()) { diff --git a/common/common.h b/common/common.h index bdb16f412..d7c08f20a 100644 --- a/common/common.h +++ b/common/common.h @@ -386,8 +386,6 @@ bool gpt_params_parse_ex(int argc, char ** argv, gpt_params & params, std::vecto // print full usage message; it will be called internally by gpt_params_parse() if "-h" is set void gpt_params_print_usage(gpt_params & params, std::vector & options); -void gpt_params_handle_model_default(gpt_params & params); - std::string gpt_params_get_system_info(const gpt_params & params); bool parse_cpu_range(const std::string& range, bool(&boolmask)[GGML_MAX_N_THREADS]); diff --git a/examples/export-docs/CMakeLists.txt b/examples/gen-docs/CMakeLists.txt similarity index 70% rename from examples/export-docs/CMakeLists.txt rename to examples/gen-docs/CMakeLists.txt index 0e953167e..c94cda776 100644 --- a/examples/export-docs/CMakeLists.txt +++ b/examples/gen-docs/CMakeLists.txt @@ -1,5 +1,5 @@ -set(TARGET llama-export-docs) -add_executable(${TARGET} export-docs.cpp) +set(TARGET llama-gen-docs) +add_executable(${TARGET} gen-docs.cpp) install(TARGETS ${TARGET} RUNTIME) target_link_libraries(${TARGET} PRIVATE common llama ${CMAKE_THREAD_LIBS_INIT}) target_compile_features(${TARGET} PRIVATE cxx_std_11) diff --git a/examples/export-docs/export-docs.cpp b/examples/gen-docs/gen-docs.cpp similarity index 95% rename from examples/export-docs/export-docs.cpp rename to examples/gen-docs/gen-docs.cpp index a09036dcf..8b1dafd63 100644 --- a/examples/export-docs/export-docs.cpp +++ b/examples/gen-docs/gen-docs.cpp @@ -1,11 +1,7 @@ #include "common.h" -#include "llama.h" -#include -#include #include #include -#include // Export usage message (-h) to markdown format