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" {
529
529
struct llama_lora_adapter * adapter,
530
530
float scale);
531
531
532
- // Remove a LoRA adapter from given context
532
+ // Remove a specific LoRA adapter from given context
533
533
// Return -1 if the adapter is not present in the context
534
534
LLAMA_API int32_t llama_lora_adapter_remove (
535
535
struct llama_context * ctx,
536
536
struct llama_lora_adapter * adapter);
537
537
538
+ // Remove all LoRA adapters from given context
539
+ LLAMA_API void llama_lora_adapter_clear (
540
+ struct llama_context * ctx);
541
+
538
542
// Manually free a LoRA adapter
539
543
// Note: loaded adapters will be free when the associated model is deleted
540
544
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(
16201
16201
return -1;
16202
16202
}
16203
16203
16204
+ void llama_lora_adapter_clear(struct llama_context * ctx) {
16205
+ ctx->lora_adapters.clear();
16206
+ }
16207
+
16204
16208
void llama_lora_adapter_free(struct llama_lora_adapter * adapter) {
16205
16209
delete adapter;
16206
16210
}
You can’t perform that action at this time.
0 commit comments