Skip to content

Commit

Permalink
Update llama.cpp, sync patches (#171)
Browse files Browse the repository at this point in the history
  • Loading branch information
mudler authored Aug 14, 2023
1 parent ef532c4 commit 18f25c2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 13 deletions.
2 changes: 1 addition & 1 deletion llama.cpp
21 changes: 9 additions & 12 deletions patches/1902-cuda.patch
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
diff --git a/examples/common.cpp b/examples/common.cpp
index 3e7c3b6..df96f09 100644
index 9f8aab9..be2966a 100644
--- a/examples/common.cpp
+++ b/examples/common.cpp
@@ -675,19 +675,6 @@ std::tuple<struct llama_model *, struct llama_context *> llama_init_from_gpt_par
@@ -684,18 +684,93 @@ std::tuple<struct llama_model *, struct llama_context *> llama_init_from_gpt_par
return std::make_tuple(nullptr, nullptr);
}

Expand All @@ -21,11 +21,7 @@ index 3e7c3b6..df96f09 100644
-
return std::make_tuple(model, lctx);
}

@@ -1063,3 +1050,90 @@ bool console_readline(console_state & con_st, std::string & line) {
fflush(con_st.out);
return has_more;
}
+
+
+gpt_params* create_gpt_params(const std::string& fname) {
+ gpt_params* lparams = new gpt_params;
Expand Down Expand Up @@ -115,17 +111,18 @@ index 3e7c3b6..df96f09 100644
+}
\ No newline at end of file
diff --git a/examples/common.h b/examples/common.h
index 9744842..1110a14 100644
index 375bc0a..b165b18 100644
--- a/examples/common.h
+++ b/examples/common.h
@@ -155,3 +155,10 @@ void console_init(console_state & con_st);
void console_cleanup(console_state & con_st);
void console_set_color(console_state & con_st, console_color_t color);
bool console_readline(console_state & con_st, std::string & line);
@@ -112,3 +112,10 @@ std::vector<llama_token> llama_tokenize(struct llama_context * ctx, const std::s

std::tuple<struct llama_model *, struct llama_context *> llama_init_from_gpt_params(const gpt_params & params);
struct llama_context_params llama_context_params_from_gpt_params(const gpt_params & params);
+
+struct llama_state {
+ llama_context * ctx;
+ llama_model * model;
+};
+
+void* load_binding_model(const char *fname, int n_ctx, int n_seed, bool memory_f16, bool mlock, bool embeddings, bool mmap, bool low_vram, int n_gpu_layers, int n_batch, const char *maingpu, const char *tensorsplit, bool numa, float rope_freq_base, float rope_freq_scale, float rms_norm_eps, int n_gqa);
\ No newline at end of file

0 comments on commit 18f25c2

Please sign in to comment.