File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed
Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -529,12 +529,16 @@ extern "C" {
529529 struct llama_lora_adapter * adapter,
530530 float scale);
531531
532- // Remove a LoRA adapter from given context
532+ // Remove a specific LoRA adapter from given context
533533 // Return -1 if the adapter is not present in the context
534534 LLAMA_API int32_t llama_lora_adapter_remove (
535535 struct llama_context * ctx,
536536 struct llama_lora_adapter * adapter);
537537
538+ // Remove all LoRA adapters from given context
539+ LLAMA_API void llama_lora_adapter_clear (
540+ struct llama_context * ctx);
541+
538542 // Manually free a LoRA adapter
539543 // Note: loaded adapters will be free when the associated model is deleted
540544 LLAMA_API void llama_lora_adapter_free (struct llama_lora_adapter * adapter);
Original file line number Diff line number Diff line change @@ -16201,6 +16201,10 @@ int32_t llama_lora_adapter_remove(
1620116201 return -1;
1620216202}
1620316203
16204+ void llama_lora_adapter_clear(struct llama_context * ctx) {
16205+ ctx->lora_adapters.clear();
16206+ }
16207+
1620416208void llama_lora_adapter_free(struct llama_lora_adapter * adapter) {
1620516209 delete adapter;
1620616210}
You can’t perform that action at this time.
0 commit comments