diff options
author | slaren <2141330+slaren@users.noreply.github.com> | 2023-04-17 17:28:55 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-17 17:28:55 +0200 |
commit | 315a95a4d30db726fb7d244dd3b9e90a83fb1616 (patch) | |
tree | 569d8140cde36ad971d3d3120556ab5533603931 /llama.h | |
parent | efd05648c88a0923a55f56e7ce1b0f9c33410afb (diff) |
Add LoRA support (#820)
Diffstat (limited to 'llama.h')
-rw-r--r-- | llama.h | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -96,6 +96,18 @@ extern "C" { const char * fname_out, enum llama_ftype ftype); + // Apply a LoRA adapter to a loaded model + // path_base_model is the path to a higher quality model to use as a base for + // the layers modified by the adapter. Can be NULL to use the current loaded model. + // The model needs to be reloaded before applying a new adapter, otherwise the adapter + // will be applied on top of the previous one + // Returns 0 on success + LLAMA_API int llama_apply_lora_from_file( + struct llama_context * ctx, + const char * path_lora, + const char * path_base_model, + int n_threads); + // Returns the KV cache that will contain the context for the // ongoing prediction with the model. LLAMA_API const uint8_t * llama_get_kv_cache(struct llama_context * ctx); |