Allow params.js to be embedded in server.cpp

This commit is contained in:
xatier 2024-04-24 20:35:57 -05:00
parent c724e32573
commit 33c60537e8
No known key found for this signature in database
GPG key ID: EE2C5C1F7D756A33
4 changed files with 5 additions and 3 deletions

View file

@ -796,7 +796,7 @@ save-load-state: examples/save-load-state/save-load-state.cpp ggml.o llama.o $(C
$(CXX) $(CXXFLAGS) -c $< -o $(call GET_OBJ_FILE, $<)
$(CXX) $(CXXFLAGS) $(filter-out %.h $<,$^) $(call GET_OBJ_FILE, $<) -o $@ $(LDFLAGS)
server: examples/server/server.cpp examples/server/utils.hpp examples/server/httplib.h common/json.hpp examples/server/index.html.hpp examples/server/index.js.hpp examples/server/completion.js.hpp examples/server/json-schema-to-grammar.mjs.hpp common/stb_image.h ggml.o llama.o $(COMMON_DEPS) grammar-parser.o $(OBJS)
server: examples/server/server.cpp examples/server/utils.hpp examples/server/httplib.h common/json.hpp examples/server/index.html.hpp examples/server/index.js.hpp examples/server/completion.js.hpp examples/server/params.js.hpp examples/server/json-schema-to-grammar.mjs.hpp common/stb_image.h ggml.o llama.o $(COMMON_DEPS) grammar-parser.o $(OBJS)
$(CXX) $(CXXFLAGS) -c $< -o $(call GET_OBJ_FILE, $<)
$(CXX) $(CXXFLAGS) $(filter-out %.h %.hpp $<,$^) -Iexamples/server $(call GET_OBJ_FILE, $<) -o $@ $(LDFLAGS) $(LWINSOCK2)

View file

@ -141,7 +141,7 @@ pub fn build(b: *std.build.Builder) !void {
server.linkSystemLibrary("ws2_32");
}
const server_assets = [_][]const u8{ "index.html", "index.js", "completion.js", "json-schema-to-grammar.mjs" };
const server_assets = [_][]const u8{ "index.html", "index.js", "completion.js", "params.js", "json-schema-to-grammar.mjs" };
for (server_assets) |asset| {
const input_path = b.fmt("examples/server/public/{s}", .{asset});
const output_path = b.fmt("examples/server/{s}.hpp", .{asset});

View file

@ -11,6 +11,7 @@ set(PUBLIC_ASSETS
index.html
index.js
completion.js
params.js
json-schema-to-grammar.mjs
)
foreach(asset ${PUBLIC_ASSETS})

View file

@ -14,10 +14,11 @@
#include "httplib.h"
#include "json.hpp"
// auto generated files (update with ./deps.sh)
// auto generated files (update during build time (#6661))
#include "index.html.hpp"
#include "index.js.hpp"
#include "completion.js.hpp"
#include "params.js.hpp"
#include "json-schema-to-grammar.mjs.hpp"
#include <atomic>