From 41cbd2b8aff97c7297b3dbddbad6dfbb0f164380 Mon Sep 17 00:00:00 2001 From: Luke Stanley Date: Tue, 4 Jul 2023 20:42:33 +0100 Subject: [PATCH] Probably broken hack exploring emscripten --- Makefile | 8 ++++++-- examples/common.h | 4 ++-- examples/main/main.cpp | 8 ++++---- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index 03f38bdba04ec..f95ce580b15ed 100644 --- a/Makefile +++ b/Makefile @@ -272,8 +272,9 @@ libllama.so: llama.o ggml.o $(OBJS) $(CXX) $(CXXFLAGS) -shared -fPIC -o $@ $^ $(LDFLAGS) clean: - rm -vf *.o *.so main quantize quantize-stats perplexity embedding benchmark-matmult save-load-state server vdot train-text-from-scratch embd-input-test build-info.h - + rm -vf *.o *.so quantize quantize-stats perplexity embedding benchmark-matmult save-load-state server vdot train-text-from-scratch embd-input-test build-info.h + rm -f *.o main.{html,wasm,js,data,worker.js} + rm -f common.o examples/common.o # # Examples # @@ -284,6 +285,9 @@ main: examples/main/main.cpp build-info.h ggml. @echo '==== Run ./main -h for help. ====' @echo +main.html: examples/main/main.cpp ggml.o llama.o examples/common.o $(OBJS) + $(CXX) $(CXXFLAGS) examples/main/main.cpp ggml.o llama.o examples/common.o -o main.html $(LDFLAGS) + simple: examples/simple/simple.cpp build-info.h ggml.o llama.o common.o $(OBJS) $(CXX) $(CXXFLAGS) $(filter-out %.h,$^) -o $@ $(LDFLAGS) diff --git a/examples/common.h b/examples/common.h index 96f2228f8677b..0cbabefb0f9f5 100644 --- a/examples/common.h +++ b/examples/common.h @@ -2,7 +2,7 @@ #pragma once -#include "llama.h" +#include "../llama.h" #include #include @@ -48,7 +48,7 @@ struct gpt_params { float mirostat_tau = 5.00f; // target entropy float mirostat_eta = 0.10f; // learning rate - std::string model = "models/7B/ggml-model.bin"; // model path + std::string model = "models/orca-mini-3b.ggmlv3.q4_0.bin"; // model path std::string model_alias = "unknown"; // model alias std::string prompt = ""; std::string path_prompt_cache = ""; // path to file for saving/loading prompt eval state diff --git a/examples/main/main.cpp b/examples/main/main.cpp index 3a171925ba510..da4462b2a5202 100644 --- a/examples/main/main.cpp +++ b/examples/main/main.cpp @@ -3,9 +3,9 @@ #define _GNU_SOURCE #endif -#include "common.h" -#include "llama.h" -#include "build-info.h" +#include "../common.h" +#include "../../llama.h" +//#include "../../build-info.h" #include #include @@ -92,7 +92,7 @@ int main(int argc, char ** argv) { params.n_ctx = 8; } - fprintf(stderr, "%s: build = %d (%s)\n", __func__, BUILD_NUMBER, BUILD_COMMIT); + // fprintf(stderr, "%s: build = %d (%s)\n", __func__, BUILD_NUMBER, BUILD_COMMIT); if (params.seed == LLAMA_DEFAULT_SEED) { params.seed = time(NULL);