diff --git a/docs/docs/03-hooks/01-natural-language-processing/useLLM.md b/docs/docs/03-hooks/01-natural-language-processing/useLLM.md index ad26123ef..15d6d3191 100644 --- a/docs/docs/03-hooks/01-natural-language-processing/useLLM.md +++ b/docs/docs/03-hooks/01-natural-language-processing/useLLM.md @@ -561,4 +561,5 @@ const handleGenerate = async () => { | [SmolLM 2](https://huggingface.co/software-mansion/react-native-executorch-smolLm-2) | 135M, 360M, 1.7B | ✅ | - | | [LLaMA 3.2](https://huggingface.co/software-mansion/react-native-executorch-llama-3.2) | 1B, 3B | ✅ | - | | [LFM2.5](https://huggingface.co/software-mansion/react-native-executorch-lfm-2.5) | 350M, 1.2B, 1.6B-VL | ✅ | - | +| [LFM2.5-VL-450M](https://huggingface.co/software-mansion/react-native-executorch-lfm-2.5/tree/main/lfm2.5-VL-450M) | 450M | ✅ | vision | | [LFM2.5-VL-1.6B](https://huggingface.co/software-mansion/react-native-executorch-lfm-2.5/tree/main/lfm2.5-VL-1.6B) | 1.6B | ✅ | vision | diff --git a/docs/versioned_docs/version-0.8.x/03-hooks/01-natural-language-processing/useLLM.md b/docs/versioned_docs/version-0.8.x/03-hooks/01-natural-language-processing/useLLM.md index d881d9292..14fe51c21 100644 --- a/docs/versioned_docs/version-0.8.x/03-hooks/01-natural-language-processing/useLLM.md +++ b/docs/versioned_docs/version-0.8.x/03-hooks/01-natural-language-processing/useLLM.md @@ -561,4 +561,5 @@ const handleGenerate = async () => { | [SmolLM 2](https://huggingface.co/software-mansion/react-native-executorch-smolLm-2) | 135M, 360M, 1.7B | ✅ | - | | [LLaMA 3.2](https://huggingface.co/software-mansion/react-native-executorch-llama-3.2) | 1B, 3B | ✅ | - | | [LFM2.5](https://huggingface.co/software-mansion/react-native-executorch-lfm-2.5) | 350M, 1.2B, 1.6B-VL | ✅ | - | +| [LFM2.5-VL-450M](https://huggingface.co/software-mansion/react-native-executorch-lfm-2.5/tree/v0.8.0/lfm2.5-VL-450M) | 450M | ✅ | vision | | [LFM2.5-VL-1.6B](https://huggingface.co/software-mansion/react-native-executorch-lfm-2.5/tree/v0.8.0/lfm2.5-VL-1.6B) | 1.6B | ✅ | vision | diff --git a/packages/react-native-executorch/package.json b/packages/react-native-executorch/package.json index 80dbe1e06..ba8cb30bb 100644 --- a/packages/react-native-executorch/package.json +++ b/packages/react-native-executorch/package.json @@ -1,6 +1,6 @@ { "name": "react-native-executorch", - "version": "0.8.1", + "version": "0.8.2", "description": "An easy way to run AI models in React Native with ExecuTorch", "source": "./src/index.ts", "main": "./lib/module/index.js", diff --git a/packages/react-native-executorch/src/constants/modelUrls.ts b/packages/react-native-executorch/src/constants/modelUrls.ts index 2eb3c3f41..3bf07a175 100644 --- a/packages/react-native-executorch/src/constants/modelUrls.ts +++ b/packages/react-native-executorch/src/constants/modelUrls.ts @@ -433,8 +433,13 @@ export const LFM2_5_350M_QUANTIZED = { // LFM2.5-VL-1.6B const LFM2_VL_1_6B_QUANTIZED_MODEL = `${URL_PREFIX}-lfm-2.5/${VERSION_TAG}/lfm2.5-VL-1.6B/quantized/lfm2_5_vl_1_6b_8da4w_xnnpack.pte`; -const LFM2_VL_TOKENIZER = `${URL_PREFIX}-lfm-2.5/${VERSION_TAG}/lfm2.5-VL-1.6B/tokenizer.json`; -const LFM2_VL_TOKENIZER_CONFIG = `${URL_PREFIX}-lfm-2.5/${VERSION_TAG}/lfm2.5-VL-1.6B/tokenizer_config.json`; +const LFM2_VL_1_6B_TOKENIZER = `${URL_PREFIX}-lfm-2.5/${VERSION_TAG}/lfm2.5-VL-1.6B/tokenizer.json`; +const LFM2_VL_1_6B_TOKENIZER_CONFIG = `${URL_PREFIX}-lfm-2.5/${VERSION_TAG}/lfm2.5-VL-1.6B/tokenizer_config.json`; + +// LFM2.5-VL-450M +const LFM2_VL_450M_QUANTIZED_MODEL = `${URL_PREFIX}-lfm-2.5/${VERSION_TAG}/lfm2.5-VL-450M/lfm2_5_vl_450m_8da4w_xnnpack.pte`; +const LFM2_VL_450M_TOKENIZER = `${URL_PREFIX}-lfm-2.5/${VERSION_TAG}/lfm2.5-VL-450M/tokenizer.json`; +const LFM2_VL_450M_TOKENIZER_CONFIG = `${URL_PREFIX}-lfm-2.5/${VERSION_TAG}/lfm2.5-VL-450M/tokenizer_config.json`; /** * @category Models - VLM @@ -443,8 +448,19 @@ export const LFM2_VL_1_6B_QUANTIZED = { modelName: 'lfm2.5-vl-1.6b-quantized', capabilities: ['vision'], modelSource: LFM2_VL_1_6B_QUANTIZED_MODEL, - tokenizerSource: LFM2_VL_TOKENIZER, - tokenizerConfigSource: LFM2_VL_TOKENIZER_CONFIG, + tokenizerSource: LFM2_VL_1_6B_TOKENIZER, + tokenizerConfigSource: LFM2_VL_1_6B_TOKENIZER_CONFIG, +} as const; + +/** + * @category Models - VLM + */ +export const LFM2_VL_450M_QUANTIZED = { + modelName: 'lfm2.5-vl-450m-quantized', + capabilities: ['vision'], + modelSource: LFM2_VL_450M_QUANTIZED_MODEL, + tokenizerSource: LFM2_VL_450M_TOKENIZER, + tokenizerConfigSource: LFM2_VL_450M_TOKENIZER_CONFIG, } as const; // Classification @@ -1106,6 +1122,7 @@ export const MODEL_REGISTRY = { LFM2_5_1_2B_INSTRUCT, LFM2_5_1_2B_INSTRUCT_QUANTIZED, LFM2_VL_1_6B_QUANTIZED, + LFM2_VL_450M_QUANTIZED, EFFICIENTNET_V2_S, EFFICIENTNET_V2_S_QUANTIZED, SSDLITE_320_MOBILENET_V3_LARGE, diff --git a/packages/react-native-executorch/src/types/llm.ts b/packages/react-native-executorch/src/types/llm.ts index f37dbb9cd..83f9630c1 100644 --- a/packages/react-native-executorch/src/types/llm.ts +++ b/packages/react-native-executorch/src/types/llm.ts @@ -55,7 +55,8 @@ export type LLMModelName = | 'lfm2.5-350m-quantized' | 'lfm2.5-1.2b-instruct' | 'lfm2.5-1.2b-instruct-quantized' - | 'lfm2.5-vl-1.6b-quantized'; + | 'lfm2.5-vl-1.6b-quantized' + | 'lfm2.5-vl-450m-quantized'; /** * Properties for initializing and configuring a Large Language Model (LLM) instance.