Skip to content

Commit 580e02e

Browse files
committed
server : always regenerate asset hpp before compile
1 parent a73ccf1 commit 580e02e

File tree

8 files changed

+13
-3879
lines changed

8 files changed

+13
-3879
lines changed

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,8 @@ embedding: examples/embedding/embedding.cpp build-info.h ggml.
375375
save-load-state: examples/save-load-state/save-load-state.cpp build-info.h ggml.o llama.o common.o $(OBJS)
376376
$(CXX) $(CXXFLAGS) $(filter-out %.h,$^) -o $@ $(LDFLAGS)
377377

378-
server: examples/server/server.cpp examples/server/httplib.h examples/server/json.hpp examples/server/index.html.hpp examples/server/index.js.hpp examples/server/completion.js.hpp build-info.h ggml.o llama.o common.o grammar-parser.o $(OBJS)
378+
server: examples/server/server.cpp examples/server/httplib.h examples/server/json.hpp build-info.h ggml.o llama.o common.o grammar-parser.o $(OBJS)
379+
./examples/server/deps.sh --no-download
379380
$(CXX) $(CXXFLAGS) -Iexamples/server $(filter-out %.h,$(filter-out %.hpp,$^)) -o $@ $(LDFLAGS) $(LWINSOCK2)
380381

381382
$(LIB_PRE)embdinput$(DSO_EXT): examples/embd-input/embd-input.h examples/embd-input/embd-input-lib.cpp build-info.h ggml.o llama.o common.o $(OBJS)

examples/server/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*.hpp
2+
!json.hpp

examples/server/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
set(TARGET server)
22
option(LLAMA_SERVER_VERBOSE "Build verbose logging option for Server" ON)
33
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
4+
execute_process(
5+
COMMAND bash ${CMAKE_CURRENT_SOURCE_DIR}/deps.sh --no-download
6+
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
7+
)
48
add_executable(${TARGET} server.cpp json.hpp httplib.h)
59
install(TARGETS ${TARGET} RUNTIME)
610
target_compile_definitions(${TARGET} PRIVATE

examples/server/completion.js.hpp

Lines changed: 0 additions & 428 deletions
This file was deleted.

examples/server/deps.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,11 @@
55
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
66
PUBLIC=$DIR/public
77

8-
echo "download js bundle files"
9-
curl https://npm.reversehttp.com/@preact/signals-core,@preact/signals,htm/preact,preact,preact/hooks > $PUBLIC/index.js
10-
echo >> $PUBLIC/index.js # add newline
8+
if [ "$1" != "--no-download" ]; then
9+
echo "download js bundle files"
10+
curl https://npm.reversehttp.com/@preact/signals-core,@preact/signals,htm/preact,preact,preact/hooks > $PUBLIC/index.js
11+
echo >> $PUBLIC/index.js # add newline
12+
fi
1113

1214
FILES=$(ls $PUBLIC)
1315

examples/server/index.html.hpp

Lines changed: 0 additions & 1260 deletions
This file was deleted.

examples/server/index.js.hpp

Lines changed: 0 additions & 1876 deletions
This file was deleted.

examples/server/json-schema-to-grammar.mjs.hpp

Lines changed: 0 additions & 311 deletions
This file was deleted.

0 commit comments

Comments
 (0)