Skip to content

Commit

Permalink
fix(ios): removeLoraAdapters
Browse files Browse the repository at this point in the history
  • Loading branch information
jhen0409 committed Nov 21, 2024
1 parent 8560f03 commit 1569797
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
12 changes: 12 additions & 0 deletions ios/RNLlama.mm
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,10 @@ - (NSArray *)supportedEvents {
withRejecter:(RCTPromiseRejectBlock)reject)
{
RNLlamaContext *context = llamaContexts[[NSNumber numberWithDouble:contextId]];
if (context == nil) {
reject(@"llama_error", @"Context not found", nil);
return;
}
[context applyLoraAdapters:loraAdapters];
resolve(nil);
}
Expand All @@ -286,6 +290,10 @@ - (NSArray *)supportedEvents {
withRejecter:(RCTPromiseRejectBlock)reject)
{
RNLlamaContext *context = llamaContexts[[NSNumber numberWithDouble:contextId]];
if (context == nil) {
reject(@"llama_error", @"Context not found", nil);
return;
}
[context removeLoraAdapters];
resolve(nil);
}
Expand All @@ -295,6 +303,10 @@ - (NSArray *)supportedEvents {
withRejecter:(RCTPromiseRejectBlock)reject)
{
RNLlamaContext *context = llamaContexts[[NSNumber numberWithDouble:contextId]];
if (context == nil) {
reject(@"llama_error", @"Context not found", nil);
return;
}
resolve([context getLoadedLoraAdapters]);
}

Expand Down
2 changes: 1 addition & 1 deletion ios/RNLlamaContext.mm
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,7 @@ - (void)applyLoraAdapters:(NSArray *)loraAdapters {
}

- (void)removeLoraAdapters {
[llama removeLoraAdapters];
llama->removeLoraAdapters();
}

- (NSArray *)getLoadedLoraAdapters {
Expand Down

0 comments on commit 1569797

Please sign in to comment.