Skip to content

Commit 48610bf

Browse files
authored
fix: pass capabilities to LLMController.load in LLMModule.fromModelName (#999)
## Description Fixes the arguments passed to `LLMController.load` in `LLMModule.fromModelName` to make loading VLMs work correctly. ### Introduces a breaking change? - [ ] Yes - [x] No ### Type of change - [x] Bug fix (change which fixes an issue) - [ ] New feature (change which adds functionality) - [ ] Documentation update (improves or adds clarity to existing documentation) - [ ] Other (chores, tests, code style improvements etc.) ### Tested on - [x] iOS - [ ] Android ### Testing instructions <!-- Provide step-by-step instructions on how to test your changes. Include setup details if necessary. --> Use this simple screen to test ```ts import { useEffect } from 'react'; import { LLMModule, LFM2_VL_1_6B_QUANTIZED } from 'react-native-executorch'; export default function LLMModuleExample() { useEffect(() => { const run = async () => { const llm = await LLMModule.fromModelName( LFM2_VL_1_6B_QUANTIZED, undefined, (token) => console.log(token) ); await llm.sendMessage('Hello!'); llm.delete(); }; run().catch(console.error); }, []); return null; } ``` ### Screenshots <!-- Add screenshots here, if applicable --> ### Related issues <!-- Link related issues here using #issue-number --> Closes #998 ### Checklist - [x] I have performed a self-review of my code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have updated the documentation accordingly - [x] My changes generate no new warnings ### Additional notes <!-- Include any additional information, assumptions, or context that reviewers might need to understand this PR. -->
1 parent 27592da commit 48610bf

File tree

1 file changed

+1
-0
lines changed
  • packages/react-native-executorch/src/modules/natural_language_processing

1 file changed

+1
-0
lines changed

packages/react-native-executorch/src/modules/natural_language_processing/LLMModule.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ export class LLMModule {
6262
modelSource: namedSources.modelSource,
6363
tokenizerSource: namedSources.tokenizerSource,
6464
tokenizerConfigSource: namedSources.tokenizerConfigSource,
65+
capabilities: namedSources.capabilities,
6566
onDownloadProgressCallback: onDownloadProgress,
6667
});
6768
return instance;

0 commit comments

Comments
 (0)