react-native-executorch 0.3.2 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (346) hide show
  1. package/README.md +30 -13
  2. package/android/build.gradle +1 -1
  3. package/android/libs/executorch.aar +0 -0
  4. package/android/src/main/java/com/swmansion/rnexecutorch/ETModule.kt +1 -2
  5. package/android/src/main/java/com/swmansion/rnexecutorch/ImageSegmentation.kt +58 -0
  6. package/android/src/main/java/com/swmansion/rnexecutorch/LLM.kt +13 -49
  7. package/android/src/main/java/com/swmansion/rnexecutorch/RnExecutorchPackage.kt +37 -0
  8. package/android/src/main/java/com/swmansion/rnexecutorch/StyleTransfer.kt +1 -1
  9. package/android/src/main/java/com/swmansion/rnexecutorch/TextEmbeddings.kt +51 -0
  10. package/android/src/main/java/com/swmansion/rnexecutorch/Tokenizer.kt +86 -0
  11. package/android/src/main/java/com/swmansion/rnexecutorch/models/BaseModel.kt +3 -4
  12. package/android/src/main/java/com/swmansion/rnexecutorch/models/TextEmbeddings/TextEmbeddingsModel.kt +48 -0
  13. package/android/src/main/java/com/swmansion/rnexecutorch/models/TextEmbeddings/TextEmbeddingsUtils.kt +37 -0
  14. package/android/src/main/java/com/swmansion/rnexecutorch/models/classification/ClassificationModel.kt +1 -0
  15. package/android/src/main/java/com/swmansion/rnexecutorch/models/imageSegmentation/Constants.kt +26 -0
  16. package/android/src/main/java/com/swmansion/rnexecutorch/models/imageSegmentation/ImageSegmentationModel.kt +142 -0
  17. package/android/src/main/java/com/swmansion/rnexecutorch/models/ocr/utils/RecognizerUtils.kt +3 -0
  18. package/android/src/main/java/com/swmansion/rnexecutorch/models/{StyleTransferModel.kt → styleTransfer/StyleTransferModel.kt} +2 -1
  19. package/android/src/main/java/com/swmansion/rnexecutorch/utils/ArrayUtils.kt +0 -8
  20. package/android/src/main/java/com/swmansion/rnexecutorch/{models/classification/Utils.kt → utils/Numerical.kt} +1 -1
  21. package/ios/ExecutorchLib.xcframework/Info.plist +4 -4
  22. package/ios/ExecutorchLib.xcframework/ios-arm64/ExecutorchLib.framework/ExecutorchLib +0 -0
  23. package/ios/ExecutorchLib.xcframework/ios-arm64/ExecutorchLib.framework/Headers/HuggingFaceTokenizer.h +14 -0
  24. package/ios/ExecutorchLib.xcframework/ios-arm64/ExecutorchLib.framework/Headers/LLaMARunner.h +1 -23
  25. package/ios/ExecutorchLib.xcframework/ios-arm64/ExecutorchLib.framework/Info.plist +0 -0
  26. package/ios/ExecutorchLib.xcframework/ios-arm64-simulator/ExecutorchLib.framework/ExecutorchLib +0 -0
  27. package/ios/ExecutorchLib.xcframework/ios-arm64-simulator/ExecutorchLib.framework/Headers/HuggingFaceTokenizer.h +14 -0
  28. package/ios/ExecutorchLib.xcframework/ios-arm64-simulator/ExecutorchLib.framework/Headers/LLaMARunner.h +1 -23
  29. package/ios/ExecutorchLib.xcframework/ios-arm64-simulator/ExecutorchLib.framework/Info.plist +0 -0
  30. package/ios/RnExecutorch/Classification.mm +15 -18
  31. package/ios/RnExecutorch/ETModule.mm +6 -5
  32. package/ios/RnExecutorch/ImageSegmentation.h +5 -0
  33. package/ios/RnExecutorch/ImageSegmentation.mm +60 -0
  34. package/ios/RnExecutorch/LLM.mm +12 -53
  35. package/ios/RnExecutorch/OCR.mm +39 -43
  36. package/ios/RnExecutorch/ObjectDetection.mm +20 -20
  37. package/ios/RnExecutorch/SpeechToText.mm +6 -7
  38. package/ios/RnExecutorch/StyleTransfer.mm +16 -19
  39. package/ios/RnExecutorch/TextEmbeddings.h +5 -0
  40. package/ios/RnExecutorch/TextEmbeddings.mm +62 -0
  41. package/ios/RnExecutorch/Tokenizer.h +5 -0
  42. package/ios/RnExecutorch/Tokenizer.mm +83 -0
  43. package/ios/RnExecutorch/VerticalOCR.mm +36 -36
  44. package/ios/RnExecutorch/models/BaseModel.h +2 -5
  45. package/ios/RnExecutorch/models/BaseModel.mm +5 -15
  46. package/ios/RnExecutorch/models/classification/ClassificationModel.mm +2 -3
  47. package/ios/RnExecutorch/models/classification/Constants.mm +0 -1
  48. package/ios/RnExecutorch/models/image_segmentation/Constants.h +4 -0
  49. package/ios/RnExecutorch/models/image_segmentation/Constants.mm +8 -0
  50. package/ios/RnExecutorch/models/image_segmentation/ImageSegmentationModel.h +10 -0
  51. package/ios/RnExecutorch/models/image_segmentation/ImageSegmentationModel.mm +146 -0
  52. package/ios/RnExecutorch/models/object_detection/SSDLiteLargeModel.mm +1 -2
  53. package/ios/RnExecutorch/models/ocr/Detector.h +0 -2
  54. package/ios/RnExecutorch/models/ocr/Detector.mm +2 -1
  55. package/ios/RnExecutorch/models/ocr/RecognitionHandler.h +5 -4
  56. package/ios/RnExecutorch/models/ocr/RecognitionHandler.mm +9 -26
  57. package/ios/RnExecutorch/models/ocr/Recognizer.mm +1 -2
  58. package/ios/RnExecutorch/models/ocr/VerticalDetector.h +0 -2
  59. package/ios/RnExecutorch/models/ocr/VerticalDetector.mm +2 -1
  60. package/ios/RnExecutorch/models/ocr/utils/OCRUtils.mm +0 -1
  61. package/ios/RnExecutorch/models/stt/Moonshine.mm +1 -6
  62. package/ios/RnExecutorch/models/stt/SpeechToTextBaseModel.mm +7 -11
  63. package/ios/RnExecutorch/models/stt/Whisper.mm +0 -5
  64. package/ios/RnExecutorch/models/{StyleTransferModel.h → style_transfer/StyleTransferModel.h} +1 -1
  65. package/ios/RnExecutorch/models/{StyleTransferModel.mm → style_transfer/StyleTransferModel.mm} +2 -3
  66. package/ios/RnExecutorch/models/text_embeddings/TextEmbeddingsModel.h +15 -0
  67. package/ios/RnExecutorch/models/text_embeddings/TextEmbeddingsModel.mm +45 -0
  68. package/ios/RnExecutorch/models/text_embeddings/TextEmbeddingsUtils.h +8 -0
  69. package/ios/RnExecutorch/models/text_embeddings/TextEmbeddingsUtils.mm +49 -0
  70. package/ios/RnExecutorch/utils/Conversions.h +15 -0
  71. package/ios/RnExecutorch/utils/ImageProcessor.h +0 -1
  72. package/ios/RnExecutorch/{models/classification/Utils.h → utils/Numerical.h} +0 -2
  73. package/ios/RnExecutorch/{models/classification/Utils.mm → utils/Numerical.mm} +0 -2
  74. package/ios/RnExecutorch/utils/ObjectDetectionUtils.mm +0 -2
  75. package/ios/RnExecutorch/utils/SFFT.mm +1 -1
  76. package/ios/RnExecutorch/utils/ScalarType.h +0 -2
  77. package/lib/module/Error.js +16 -2
  78. package/lib/module/Error.js.map +1 -1
  79. package/lib/module/constants/{llamaDefaults.js → llmDefaults.js} +7 -3
  80. package/lib/module/constants/llmDefaults.js.map +1 -0
  81. package/lib/module/constants/modelUrls.js +88 -27
  82. package/lib/module/constants/modelUrls.js.map +1 -1
  83. package/lib/module/constants/ocr/models.js +290 -0
  84. package/lib/module/constants/ocr/models.js.map +1 -0
  85. package/lib/module/constants/ocr/symbols.js +137 -2
  86. package/lib/module/constants/ocr/symbols.js.map +1 -1
  87. package/lib/module/constants/sttDefaults.js +50 -25
  88. package/lib/module/constants/sttDefaults.js.map +1 -1
  89. package/lib/module/controllers/LLMController.js +205 -0
  90. package/lib/module/controllers/LLMController.js.map +1 -0
  91. package/lib/module/controllers/OCRController.js +5 -10
  92. package/lib/module/controllers/OCRController.js.map +1 -1
  93. package/lib/module/controllers/SpeechToTextController.js +225 -122
  94. package/lib/module/controllers/SpeechToTextController.js.map +1 -1
  95. package/lib/module/controllers/VerticalOCRController.js +6 -10
  96. package/lib/module/controllers/VerticalOCRController.js.map +1 -1
  97. package/lib/module/hooks/computer_vision/useClassification.js +8 -23
  98. package/lib/module/hooks/computer_vision/useClassification.js.map +1 -1
  99. package/lib/module/hooks/computer_vision/useImageSegmentation.js +13 -0
  100. package/lib/module/hooks/computer_vision/useImageSegmentation.js.map +1 -0
  101. package/lib/module/hooks/computer_vision/useOCR.js +11 -6
  102. package/lib/module/hooks/computer_vision/useOCR.js.map +1 -1
  103. package/lib/module/hooks/computer_vision/useObjectDetection.js +8 -23
  104. package/lib/module/hooks/computer_vision/useObjectDetection.js.map +1 -1
  105. package/lib/module/hooks/computer_vision/useStyleTransfer.js +8 -23
  106. package/lib/module/hooks/computer_vision/useStyleTransfer.js.map +1 -1
  107. package/lib/module/hooks/computer_vision/useVerticalOCR.js +10 -7
  108. package/lib/module/hooks/computer_vision/useVerticalOCR.js.map +1 -1
  109. package/lib/module/hooks/general/useExecutorchModule.js +8 -36
  110. package/lib/module/hooks/general/useExecutorchModule.js.map +1 -1
  111. package/lib/module/hooks/natural_language_processing/useLLM.js +54 -63
  112. package/lib/module/hooks/natural_language_processing/useLLM.js.map +1 -1
  113. package/lib/module/hooks/natural_language_processing/useSpeechToText.js +15 -11
  114. package/lib/module/hooks/natural_language_processing/useSpeechToText.js.map +1 -1
  115. package/lib/module/hooks/natural_language_processing/useTextEmbeddings.js +14 -0
  116. package/lib/module/hooks/natural_language_processing/useTextEmbeddings.js.map +1 -0
  117. package/lib/module/hooks/natural_language_processing/useTokenizer.js +54 -0
  118. package/lib/module/hooks/natural_language_processing/useTokenizer.js.map +1 -0
  119. package/lib/module/hooks/useModule.js +18 -62
  120. package/lib/module/hooks/useModule.js.map +1 -1
  121. package/lib/module/index.js +16 -2
  122. package/lib/module/index.js.map +1 -1
  123. package/lib/module/modules/BaseModule.js +9 -10
  124. package/lib/module/modules/BaseModule.js.map +1 -1
  125. package/lib/module/modules/computer_vision/ClassificationModule.js +8 -5
  126. package/lib/module/modules/computer_vision/ClassificationModule.js.map +1 -1
  127. package/lib/module/modules/computer_vision/ImageSegmentationModule.js +28 -0
  128. package/lib/module/modules/computer_vision/ImageSegmentationModule.js.map +1 -0
  129. package/lib/module/modules/computer_vision/ObjectDetectionModule.js +8 -5
  130. package/lib/module/modules/computer_vision/ObjectDetectionModule.js.map +1 -1
  131. package/lib/module/modules/computer_vision/StyleTransferModule.js +8 -5
  132. package/lib/module/modules/computer_vision/StyleTransferModule.js.map +1 -1
  133. package/lib/module/modules/general/ExecutorchModule.js +8 -5
  134. package/lib/module/modules/general/ExecutorchModule.js.map +1 -1
  135. package/lib/module/modules/natural_language_processing/LLMModule.js +46 -27
  136. package/lib/module/modules/natural_language_processing/LLMModule.js.map +1 -1
  137. package/lib/module/modules/natural_language_processing/SpeechToTextModule.js +8 -5
  138. package/lib/module/modules/natural_language_processing/SpeechToTextModule.js.map +1 -1
  139. package/lib/module/modules/natural_language_processing/TextEmbeddingsModule.js +14 -0
  140. package/lib/module/modules/natural_language_processing/TextEmbeddingsModule.js.map +1 -0
  141. package/lib/module/modules/natural_language_processing/TokenizerModule.js +26 -0
  142. package/lib/module/modules/natural_language_processing/TokenizerModule.js.map +1 -0
  143. package/lib/module/native/NativeClassification.js.map +1 -1
  144. package/lib/module/native/NativeImageSegmentation.js +5 -0
  145. package/lib/module/native/NativeImageSegmentation.js.map +1 -0
  146. package/lib/module/native/NativeLLM.js.map +1 -1
  147. package/lib/module/native/NativeTextEmbeddings.js +5 -0
  148. package/lib/module/native/NativeTextEmbeddings.js.map +1 -0
  149. package/lib/module/native/NativeTokenizer.js +5 -0
  150. package/lib/module/native/NativeTokenizer.js.map +1 -0
  151. package/lib/module/native/RnExecutorchModules.js +18 -113
  152. package/lib/module/native/RnExecutorchModules.js.map +1 -1
  153. package/lib/module/types/common.js.map +1 -1
  154. package/lib/module/types/imageSegmentation.js +29 -0
  155. package/lib/module/types/imageSegmentation.js.map +1 -0
  156. package/lib/module/types/llm.js +7 -0
  157. package/lib/module/types/llm.js.map +1 -0
  158. package/lib/module/types/{object_detection.js → objectDetection.js} +1 -1
  159. package/lib/module/types/objectDetection.js.map +1 -0
  160. package/lib/module/types/ocr.js +2 -0
  161. package/lib/module/types/stt.js +82 -0
  162. package/lib/module/types/stt.js.map +1 -0
  163. package/lib/module/utils/ResourceFetcher.js +156 -0
  164. package/lib/module/utils/ResourceFetcher.js.map +1 -0
  165. package/lib/module/utils/llm.js +25 -0
  166. package/lib/module/utils/llm.js.map +1 -0
  167. package/lib/module/utils/stt.js +22 -0
  168. package/lib/module/utils/stt.js.map +1 -0
  169. package/lib/typescript/Error.d.ts +4 -1
  170. package/lib/typescript/Error.d.ts.map +1 -1
  171. package/lib/typescript/constants/{llamaDefaults.d.ts → llmDefaults.d.ts} +5 -5
  172. package/lib/typescript/constants/llmDefaults.d.ts.map +1 -0
  173. package/lib/typescript/constants/modelUrls.d.ts +74 -28
  174. package/lib/typescript/constants/modelUrls.d.ts.map +1 -1
  175. package/lib/typescript/constants/ocr/models.d.ts +285 -0
  176. package/lib/typescript/constants/ocr/models.d.ts.map +1 -0
  177. package/lib/typescript/constants/ocr/symbols.d.ts +73 -1
  178. package/lib/typescript/constants/ocr/symbols.d.ts.map +1 -1
  179. package/lib/typescript/constants/sttDefaults.d.ts +8 -13
  180. package/lib/typescript/constants/sttDefaults.d.ts.map +1 -1
  181. package/lib/typescript/controllers/LLMController.d.ts +46 -0
  182. package/lib/typescript/controllers/LLMController.d.ts.map +1 -0
  183. package/lib/typescript/controllers/OCRController.d.ts.map +1 -1
  184. package/lib/typescript/controllers/SpeechToTextController.d.ts +30 -16
  185. package/lib/typescript/controllers/SpeechToTextController.d.ts.map +1 -1
  186. package/lib/typescript/controllers/VerticalOCRController.d.ts +1 -1
  187. package/lib/typescript/controllers/VerticalOCRController.d.ts.map +1 -1
  188. package/lib/typescript/hooks/computer_vision/useClassification.d.ts +5 -5
  189. package/lib/typescript/hooks/computer_vision/useClassification.d.ts.map +1 -1
  190. package/lib/typescript/hooks/computer_vision/useImageSegmentation.d.ts +37 -0
  191. package/lib/typescript/hooks/computer_vision/useImageSegmentation.d.ts.map +1 -0
  192. package/lib/typescript/hooks/computer_vision/useOCR.d.ts +2 -1
  193. package/lib/typescript/hooks/computer_vision/useOCR.d.ts.map +1 -1
  194. package/lib/typescript/hooks/computer_vision/useObjectDetection.d.ts +5 -4
  195. package/lib/typescript/hooks/computer_vision/useObjectDetection.d.ts.map +1 -1
  196. package/lib/typescript/hooks/computer_vision/useStyleTransfer.d.ts +4 -2
  197. package/lib/typescript/hooks/computer_vision/useStyleTransfer.d.ts.map +1 -1
  198. package/lib/typescript/hooks/computer_vision/useVerticalOCR.d.ts +2 -1
  199. package/lib/typescript/hooks/computer_vision/useVerticalOCR.d.ts.map +1 -1
  200. package/lib/typescript/hooks/general/useExecutorchModule.d.ts +5 -6
  201. package/lib/typescript/hooks/general/useExecutorchModule.d.ts.map +1 -1
  202. package/lib/typescript/hooks/natural_language_processing/useLLM.d.ts +6 -6
  203. package/lib/typescript/hooks/natural_language_processing/useLLM.d.ts.map +1 -1
  204. package/lib/typescript/hooks/natural_language_processing/useSpeechToText.d.ts +7 -3
  205. package/lib/typescript/hooks/natural_language_processing/useSpeechToText.d.ts.map +1 -1
  206. package/lib/typescript/hooks/natural_language_processing/useTextEmbeddings.d.ts +13 -0
  207. package/lib/typescript/hooks/natural_language_processing/useTextEmbeddings.d.ts.map +1 -0
  208. package/lib/typescript/hooks/natural_language_processing/useTokenizer.d.ts +16 -0
  209. package/lib/typescript/hooks/natural_language_processing/useTokenizer.d.ts.map +1 -0
  210. package/lib/typescript/hooks/useModule.d.ts +11 -10
  211. package/lib/typescript/hooks/useModule.d.ts.map +1 -1
  212. package/lib/typescript/index.d.ts +15 -2
  213. package/lib/typescript/index.d.ts.map +1 -1
  214. package/lib/typescript/modules/BaseModule.d.ts +4 -5
  215. package/lib/typescript/modules/BaseModule.d.ts.map +1 -1
  216. package/lib/typescript/modules/computer_vision/ClassificationModule.d.ts +7 -7
  217. package/lib/typescript/modules/computer_vision/ClassificationModule.d.ts.map +1 -1
  218. package/lib/typescript/modules/computer_vision/ImageSegmentationModule.d.ts +32 -0
  219. package/lib/typescript/modules/computer_vision/ImageSegmentationModule.d.ts.map +1 -0
  220. package/lib/typescript/modules/computer_vision/OCRModule.d.ts.map +1 -1
  221. package/lib/typescript/modules/computer_vision/ObjectDetectionModule.d.ts +6 -5
  222. package/lib/typescript/modules/computer_vision/ObjectDetectionModule.d.ts.map +1 -1
  223. package/lib/typescript/modules/computer_vision/StyleTransferModule.d.ts +6 -5
  224. package/lib/typescript/modules/computer_vision/StyleTransferModule.d.ts.map +1 -1
  225. package/lib/typescript/modules/computer_vision/VerticalOCRModule.d.ts.map +1 -1
  226. package/lib/typescript/modules/general/ExecutorchModule.d.ts +4 -3
  227. package/lib/typescript/modules/general/ExecutorchModule.d.ts.map +1 -1
  228. package/lib/typescript/modules/natural_language_processing/LLMModule.d.ts +19 -5
  229. package/lib/typescript/modules/natural_language_processing/LLMModule.d.ts.map +1 -1
  230. package/lib/typescript/modules/natural_language_processing/SpeechToTextModule.d.ts +7 -4
  231. package/lib/typescript/modules/natural_language_processing/SpeechToTextModule.d.ts.map +1 -1
  232. package/lib/typescript/modules/natural_language_processing/TextEmbeddingsModule.d.ts +8 -0
  233. package/lib/typescript/modules/natural_language_processing/TextEmbeddingsModule.d.ts.map +1 -0
  234. package/lib/typescript/modules/natural_language_processing/TokenizerModule.d.ts +12 -0
  235. package/lib/typescript/modules/natural_language_processing/TokenizerModule.d.ts.map +1 -0
  236. package/lib/typescript/native/NativeClassification.d.ts.map +1 -1
  237. package/lib/typescript/native/NativeImageSegmentation.d.ts +10 -0
  238. package/lib/typescript/native/NativeImageSegmentation.d.ts.map +1 -0
  239. package/lib/typescript/native/NativeLLM.d.ts +3 -4
  240. package/lib/typescript/native/NativeLLM.d.ts.map +1 -1
  241. package/lib/typescript/native/NativeObjectDetection.d.ts +1 -1
  242. package/lib/typescript/native/NativeObjectDetection.d.ts.map +1 -1
  243. package/lib/typescript/native/NativeSpeechToText.d.ts +2 -2
  244. package/lib/typescript/native/NativeSpeechToText.d.ts.map +1 -1
  245. package/lib/typescript/native/NativeTextEmbeddings.d.ts +8 -0
  246. package/lib/typescript/native/NativeTextEmbeddings.d.ts.map +1 -0
  247. package/lib/typescript/native/NativeTokenizer.d.ts +12 -0
  248. package/lib/typescript/native/NativeTokenizer.d.ts.map +1 -0
  249. package/lib/typescript/native/RnExecutorchModules.d.ts +18 -41
  250. package/lib/typescript/native/RnExecutorchModules.d.ts.map +1 -1
  251. package/lib/typescript/types/common.d.ts +1 -26
  252. package/lib/typescript/types/common.d.ts.map +1 -1
  253. package/lib/typescript/types/imageSegmentation.d.ts +25 -0
  254. package/lib/typescript/types/imageSegmentation.d.ts.map +1 -0
  255. package/lib/typescript/types/llm.d.ts +38 -0
  256. package/lib/typescript/types/llm.d.ts.map +1 -0
  257. package/lib/typescript/types/{object_detection.d.ts → objectDetection.d.ts} +1 -1
  258. package/lib/typescript/types/objectDetection.d.ts.map +1 -0
  259. package/lib/typescript/types/ocr.d.ts +2 -1
  260. package/lib/typescript/types/ocr.d.ts.map +1 -1
  261. package/lib/typescript/types/stt.d.ts +91 -0
  262. package/lib/typescript/types/stt.d.ts.map +1 -0
  263. package/lib/typescript/utils/ResourceFetcher.d.ts +17 -0
  264. package/lib/typescript/utils/ResourceFetcher.d.ts.map +1 -0
  265. package/lib/typescript/utils/llm.d.ts +3 -0
  266. package/lib/typescript/utils/llm.d.ts.map +1 -0
  267. package/lib/typescript/utils/stt.d.ts +2 -0
  268. package/lib/typescript/utils/stt.d.ts.map +1 -0
  269. package/package.json +12 -48
  270. package/react-native-executorch.podspec +1 -1
  271. package/src/Error.ts +16 -3
  272. package/src/constants/llmDefaults.ts +14 -0
  273. package/src/constants/modelUrls.ts +146 -39
  274. package/src/constants/ocr/models.ts +453 -0
  275. package/src/constants/ocr/symbols.ts +147 -3
  276. package/src/constants/sttDefaults.ts +55 -37
  277. package/src/controllers/LLMController.ts +286 -0
  278. package/src/controllers/OCRController.ts +14 -28
  279. package/src/controllers/SpeechToTextController.ts +318 -180
  280. package/src/controllers/VerticalOCRController.ts +17 -32
  281. package/src/hooks/computer_vision/useClassification.ts +11 -26
  282. package/src/hooks/computer_vision/useImageSegmentation.ts +18 -0
  283. package/src/hooks/computer_vision/useOCR.ts +17 -5
  284. package/src/hooks/computer_vision/useObjectDetection.ts +10 -24
  285. package/src/hooks/computer_vision/useStyleTransfer.ts +9 -25
  286. package/src/hooks/computer_vision/useVerticalOCR.ts +11 -4
  287. package/src/hooks/general/useExecutorchModule.ts +10 -50
  288. package/src/hooks/natural_language_processing/useLLM.ts +80 -97
  289. package/src/hooks/natural_language_processing/useSpeechToText.ts +39 -12
  290. package/src/hooks/natural_language_processing/useTextEmbeddings.ts +18 -0
  291. package/src/hooks/natural_language_processing/useTokenizer.ts +61 -0
  292. package/src/hooks/useModule.ts +32 -92
  293. package/src/index.tsx +16 -2
  294. package/src/modules/BaseModule.ts +16 -26
  295. package/src/modules/computer_vision/ClassificationModule.ts +13 -8
  296. package/src/modules/computer_vision/ImageSegmentationModule.ts +39 -0
  297. package/src/modules/computer_vision/ObjectDetectionModule.ts +13 -8
  298. package/src/modules/computer_vision/StyleTransferModule.ts +13 -8
  299. package/src/modules/general/ExecutorchModule.ts +11 -6
  300. package/src/modules/natural_language_processing/LLMModule.ts +64 -51
  301. package/src/modules/natural_language_processing/SpeechToTextModule.ts +25 -10
  302. package/src/modules/natural_language_processing/TextEmbeddingsModule.ts +18 -0
  303. package/src/modules/natural_language_processing/TokenizerModule.ts +34 -0
  304. package/src/native/NativeClassification.ts +0 -1
  305. package/src/native/NativeImageSegmentation.ts +14 -0
  306. package/src/native/NativeLLM.ts +3 -10
  307. package/src/native/NativeObjectDetection.ts +1 -1
  308. package/src/native/NativeSpeechToText.ts +2 -2
  309. package/src/native/NativeTextEmbeddings.ts +9 -0
  310. package/src/native/NativeTokenizer.ts +13 -0
  311. package/src/native/RnExecutorchModules.ts +54 -234
  312. package/src/types/common.ts +1 -44
  313. package/src/types/imageSegmentation.ts +25 -0
  314. package/src/types/llm.ts +57 -0
  315. package/src/types/ocr.ts +3 -1
  316. package/src/types/stt.ts +93 -0
  317. package/src/utils/ResourceFetcher.ts +196 -0
  318. package/src/utils/llm.ts +34 -0
  319. package/src/utils/stt.ts +28 -0
  320. package/android/src/main/java/com/swmansion/rnexecutorch/utils/llms/ConversationManager.kt +0 -68
  321. package/ios/ExecutorchLib.xcframework/ios-arm64-simulator/ExecutorchLib.framework/_CodeSignature/CodeResources +0 -124
  322. package/ios/RnExecutorch/utils/llms/Constants.h +0 -6
  323. package/ios/RnExecutorch/utils/llms/Constants.mm +0 -23
  324. package/ios/RnExecutorch/utils/llms/ConversationManager.h +0 -26
  325. package/ios/RnExecutorch/utils/llms/ConversationManager.mm +0 -71
  326. package/lib/module/constants/llamaDefaults.js.map +0 -1
  327. package/lib/module/modules/computer_vision/BaseCVModule.js +0 -14
  328. package/lib/module/modules/computer_vision/BaseCVModule.js.map +0 -1
  329. package/lib/module/types/object_detection.js.map +0 -1
  330. package/lib/module/utils/fetchResource.js +0 -93
  331. package/lib/module/utils/fetchResource.js.map +0 -1
  332. package/lib/module/utils/listDownloadedResources.js +0 -13
  333. package/lib/module/utils/listDownloadedResources.js.map +0 -1
  334. package/lib/typescript/constants/llamaDefaults.d.ts.map +0 -1
  335. package/lib/typescript/modules/computer_vision/BaseCVModule.d.ts +0 -9
  336. package/lib/typescript/modules/computer_vision/BaseCVModule.d.ts.map +0 -1
  337. package/lib/typescript/types/object_detection.d.ts.map +0 -1
  338. package/lib/typescript/utils/fetchResource.d.ts +0 -3
  339. package/lib/typescript/utils/fetchResource.d.ts.map +0 -1
  340. package/lib/typescript/utils/listDownloadedResources.d.ts +0 -3
  341. package/lib/typescript/utils/listDownloadedResources.d.ts.map +0 -1
  342. package/src/constants/llamaDefaults.ts +0 -9
  343. package/src/modules/computer_vision/BaseCVModule.ts +0 -22
  344. package/src/utils/fetchResource.ts +0 -106
  345. package/src/utils/listDownloadedResources.ts +0 -12
  346. /package/src/types/{object_detection.ts → objectDetection.ts} +0 -0
@@ -0,0 +1,17 @@
1
+ import { ResourceSource } from '../types/common';
2
+ export declare class ResourceFetcher {
3
+ static fetch(source: ResourceSource, callback?: (downloadProgress: number) => void): Promise<string>;
4
+ static fetchMultipleResources(callback?: (downloadProgress: number) => void, ...sources: ResourceSource[]): Promise<string[]>;
5
+ static deleteMultipleResources(...sources: ResourceSource[]): Promise<void>;
6
+ private static calculateDownloadProgress;
7
+ static listDownloadedFiles(): Promise<string[]>;
8
+ static listDownloadedModels(): Promise<string[]>;
9
+ private static handleObject;
10
+ private static getFilenameFromUri;
11
+ private static removeFilePrefix;
12
+ private static hashObject;
13
+ private static triggerHuggingFaceDownloadCounter;
14
+ private static createDirectoryIfNoExists;
15
+ private static checkFileExists;
16
+ }
17
+ //# sourceMappingURL=ResourceFetcher.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ResourceFetcher.d.ts","sourceRoot":"","sources":["../../../src/utils/ResourceFetcher.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEjD,qBAAa,eAAe;WACb,KAAK,CAChB,MAAM,EAAE,cAAc,EACtB,QAAQ,GAAE,CAAC,gBAAgB,EAAE,MAAM,KAAK,IAAe;WAuD5C,sBAAsB,CACjC,QAAQ,GAAE,CAAC,gBAAgB,EAAE,MAAM,KAAK,IAAe,EACvD,GAAG,OAAO,EAAE,cAAc,EAAE;WAgBjB,uBAAuB,CAAC,GAAG,OAAO,EAAE,cAAc,EAAE;IAUjE,OAAO,CAAC,MAAM,CAAC,yBAAyB;WAkB3B,mBAAmB;WAKnB,oBAAoB;mBAKZ,YAAY;IAkBjC,OAAO,CAAC,MAAM,CAAC,kBAAkB;IAMjC,OAAO,CAAC,MAAM,CAAC,gBAAgB;IAI/B,OAAO,CAAC,MAAM,CAAC,UAAU;IAgBzB,OAAO,CAAC,MAAM,CAAC,iCAAiC;mBAW3B,yBAAyB;mBAMzB,eAAe;CAIrC"}
@@ -0,0 +1,3 @@
1
+ import { ToolCall } from '../types/llm';
2
+ export declare const parseToolCall: (message: string) => ToolCall[];
3
+ //# sourceMappingURL=llm.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"llm.d.ts","sourceRoot":"","sources":["../../../src/utils/llm.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,QAAQ,EAAE,MAAM,cAAc,CAAC;AAEjD,eAAO,MAAM,aAAa,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,QAAQ,EA+BxD,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const longCommonInfPref: (seq1: number[], seq2: number[], hammingDistThreshold: number) => number;
2
+ //# sourceMappingURL=stt.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stt.d.ts","sourceRoot":"","sources":["../../../src/utils/stt.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,iBAAiB,GAC5B,MAAM,MAAM,EAAE,EACd,MAAM,MAAM,EAAE,EACd,sBAAsB,MAAM,WAwB7B,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-executorch",
3
- "version": "0.3.2",
3
+ "version": "0.4.1",
4
4
  "description": "An easy way to run AI models in react native with ExecuTorch",
5
5
  "source": "./src/index.ts",
6
6
  "main": "./lib/commonjs/index.js",
@@ -60,22 +60,24 @@
60
60
  },
61
61
  "devDependencies": {
62
62
  "@commitlint/config-conventional": "^17.0.2",
63
+ "@cspell/eslint-plugin": "^8.18.1",
63
64
  "@evilmartians/lefthook": "^1.5.0",
64
65
  "@react-native-community/cli": "latest",
65
- "@react-native/eslint-config": "^0.73.1",
66
+ "@react-native/eslint-config": "^0.79.0",
66
67
  "@release-it/conventional-changelog": "^5.0.0",
67
68
  "@types/jest": "^29.5.5",
68
69
  "@types/react": "^18.2.44",
69
70
  "commitlint": "^17.0.2",
71
+ "cspell": "^8.19.2",
70
72
  "del-cli": "^5.1.0",
71
- "eslint": "^8.51.0",
73
+ "eslint": "^8.57.1",
72
74
  "eslint-config-prettier": "^9.0.0",
73
75
  "eslint-plugin-prettier": "^5.0.1",
74
76
  "jest": "^29.7.0",
75
77
  "metro-react-native-babel-preset": "^0.77.0",
76
78
  "prettier": "^3.0.3",
77
- "react": "18.3.1",
78
- "react-native": "^0.76.1",
79
+ "react": "^19.1.0",
80
+ "react-native": "^0.79.2",
79
81
  "react-native-builder-bob": "^0.30.2",
80
82
  "turbo": "^1.10.7",
81
83
  "typescript": "^5.2.2"
@@ -120,45 +122,6 @@
120
122
  }
121
123
  }
122
124
  },
123
- "eslintConfig": {
124
- "parserOptions": {
125
- "requireConfigFile": false,
126
- "babelOptions": {
127
- "presets": [
128
- "@babel/preset-react"
129
- ]
130
- }
131
- },
132
- "root": true,
133
- "extends": [
134
- "@react-native",
135
- "prettier"
136
- ],
137
- "rules": {
138
- "react/react-in-jsx-scope": "off",
139
- "prettier/prettier": [
140
- "error",
141
- {
142
- "quoteProps": "consistent",
143
- "singleQuote": true,
144
- "tabWidth": 2,
145
- "trailingComma": "es5",
146
- "useTabs": false
147
- }
148
- ]
149
- }
150
- },
151
- "eslintIgnore": [
152
- "node_modules/",
153
- "lib/"
154
- ],
155
- "prettier": {
156
- "quoteProps": "consistent",
157
- "singleQuote": true,
158
- "tabWidth": 2,
159
- "trailingComma": "es5",
160
- "useTabs": false
161
- },
162
125
  "babel": {
163
126
  "presets": [
164
127
  "module:metro-react-native-babel-preset"
@@ -186,16 +149,17 @@
186
149
  },
187
150
  "codegenConfig": {
188
151
  "name": "RnExecutorchSpec",
189
- "type": "all",
152
+ "type": "modules",
190
153
  "jsSrcsDir": "./src/native",
191
154
  "android": {
192
155
  "javaPackageName": "com.swmansion.rnexecutorch"
193
156
  }
194
157
  },
195
158
  "dependencies": {
196
- "expo": "^52.0.37",
197
- "expo-asset": "^11.0.3",
198
- "expo-file-system": "^18.0.10",
159
+ "@huggingface/jinja": "^0.5.0",
160
+ "expo": "^53.0.7",
161
+ "expo-asset": "~11.1.5",
162
+ "expo-file-system": "~18.1.10",
199
163
  "react-native-live-audio-stream": "^1.1.1"
200
164
  }
201
165
  }
@@ -11,7 +11,7 @@ Pod::Spec.new do |s|
11
11
  s.authors = package["author"]
12
12
 
13
13
  s.platforms = { :ios => min_ios_version_supported }
14
- s.source = { :git => "https://github.com/NorbertKlockiewicz/react-native-executorch.git", :tag => "#{s.version}" }
14
+ s.source = { :git => "https://github.com/software-mansion/react-native-executorch.git", :tag => "#{s.version}" }
15
15
 
16
16
  s.ios.vendored_frameworks = "ios/ExecutorchLib.xcframework"
17
17
  s.source_files = "ios/**/*.{h,m,mm}"
package/src/Error.ts CHANGED
@@ -7,6 +7,11 @@ export enum ETError {
7
7
  LanguageNotSupported = 0x69,
8
8
  InvalidModelSource = 0xff,
9
9
 
10
+ //SpeechToText errors
11
+ MultilingualConfiguration = 0xa0,
12
+ MissingDataChunk = 0xa1,
13
+ StreamingNotStarted = 0xa2,
14
+
10
15
  // ExecuTorch mapped errors
11
16
  // Based on: https://github.com/pytorch/executorch/blob/main/runtime/core/error.h
12
17
  // System errors
@@ -34,14 +39,22 @@ export enum ETError {
34
39
  DelegateInvalidHandle = 0x32,
35
40
  }
36
41
 
37
- export const getError = (e: unknown | ETError): string => {
42
+ export const getError = (e: unknown | ETError | Error): string => {
38
43
  if (typeof e === 'number') {
39
44
  if (e in ETError) return ETError[e] as string;
40
45
  return ETError[ETError.UndefinedError] as string;
41
46
  }
42
47
 
48
+ // try to extract number from message (can contain false positives)
43
49
  const error = e as Error;
44
50
  const errorCode = parseInt(error.message, 10);
45
- if (errorCode in ETError) return ETError[errorCode] as string;
46
- return ETError[ETError.UndefinedError] as string;
51
+ const message = Number.isNaN(errorCode)
52
+ ? error.message
53
+ : ' ' + error.message.slice(`${errorCode}`.length).trimStart();
54
+
55
+ const ETErrorMessage = (
56
+ errorCode in ETError ? ETError[errorCode] : ETError[ETError.UndefinedError]
57
+ ) as string;
58
+
59
+ return ETErrorMessage + message;
47
60
  };
@@ -0,0 +1,14 @@
1
+ import { ChatConfig, Message } from '../types/llm';
2
+
3
+ export const DEFAULT_SYSTEM_PROMPT =
4
+ "You are a knowledgeable, efficient, and direct AI assistant. Provide concise answers, focusing on the key information needed. Offer suggestions tactfully when appropriate to improve outcomes. Engage in productive collaboration with the user. Don't return too much text.";
5
+
6
+ export const DEFAULT_MESSAGE_HISTORY: Message[] = [];
7
+
8
+ export const DEFAULT_CONTEXT_WINDOW_LENGTH = 5;
9
+
10
+ export const DEFAULT_CHAT_CONFIG: ChatConfig = {
11
+ systemPrompt: DEFAULT_SYSTEM_PROMPT,
12
+ initialMessageHistory: DEFAULT_MESSAGE_HISTORY,
13
+ contextWindowLength: DEFAULT_CONTEXT_WINDOW_LENGTH,
14
+ };
@@ -1,82 +1,187 @@
1
1
  import { Platform } from 'react-native';
2
2
 
3
3
  // LLM's
4
+
5
+ // LLAMA 3.2
4
6
  export const LLAMA3_2_3B =
5
- 'https://huggingface.co/software-mansion/react-native-executorch-llama-3.2/resolve/v0.1.0/llama-3.2-3B/original/llama3_2_3B_bf16.pte';
7
+ 'https://huggingface.co/software-mansion/react-native-executorch-llama-3.2/resolve/v0.4.0/llama-3.2-3B/original/llama3_2_3B_bf16.pte';
6
8
  export const LLAMA3_2_3B_QLORA =
7
- 'https://huggingface.co/software-mansion/react-native-executorch-llama-3.2/resolve/v0.1.0/llama-3.2-3B/QLoRA/llama3_2-3B_qat_lora.pte';
9
+ 'https://huggingface.co/software-mansion/react-native-executorch-llama-3.2/resolve/v0.4.0/llama-3.2-3B/QLoRA/llama3_2-3B_qat_lora.pte';
8
10
  export const LLAMA3_2_3B_SPINQUANT =
9
- 'https://huggingface.co/software-mansion/react-native-executorch-llama-3.2/resolve/v0.1.0/llama-3.2-3B/spinquant/llama3_2_3B_spinquant.pte';
11
+ 'https://huggingface.co/software-mansion/react-native-executorch-llama-3.2/resolve/v0.4.0/llama-3.2-3B/spinquant/llama3_2_3B_spinquant.pte';
10
12
  export const LLAMA3_2_1B =
11
- 'https://huggingface.co/software-mansion/react-native-executorch-llama-3.2/resolve/v0.1.0/llama-3.2-1B/original/llama3_2_bf16.pte';
13
+ 'https://huggingface.co/software-mansion/react-native-executorch-llama-3.2/resolve/v0.4.0/llama-3.2-1B/original/llama3_2_bf16.pte';
12
14
  export const LLAMA3_2_1B_QLORA =
13
- 'https://huggingface.co/software-mansion/react-native-executorch-llama-3.2/resolve/v0.1.0/llama-3.2-1B/QLoRA/llama3_2_qat_lora.pte';
15
+ 'https://huggingface.co/software-mansion/react-native-executorch-llama-3.2/resolve/v0.4.0/llama-3.2-1B/QLoRA/llama3_2_qat_lora.pte';
14
16
  export const LLAMA3_2_1B_SPINQUANT =
15
- 'https://huggingface.co/software-mansion/react-native-executorch-llama-3.2/resolve/v0.1.0/llama-3.2-1B/spinquant/llama3_2_spinquant.pte';
16
- export const LLAMA3_2_1B_TOKENIZER =
17
- 'https://huggingface.co/software-mansion/react-native-executorch-llama-3.2/resolve/v0.1.0/llama-3.2-1B/original/tokenizer.bin';
18
- export const LLAMA3_2_3B_TOKENIZER =
19
- 'https://huggingface.co/software-mansion/react-native-executorch-llama-3.2/resolve/v0.1.0/llama-3.2-3B/original/tokenizer.bin';
17
+ 'https://huggingface.co/software-mansion/react-native-executorch-llama-3.2/resolve/v0.4.0/llama-3.2-1B/spinquant/llama3_2_spinquant.pte';
18
+ export const LLAMA3_2_TOKENIZER =
19
+ 'https://huggingface.co/software-mansion/react-native-executorch-llama-3.2/resolve/v0.4.0/tokenizer.json';
20
+ export const LLAMA3_2_TOKENIZER_CONFIG =
21
+ 'https://huggingface.co/software-mansion/react-native-executorch-llama-3.2/resolve/v0.4.0/tokenizer_config.json';
22
+
23
+ // QWEN 3
24
+ export const QWEN3_0_6B =
25
+ 'https://huggingface.co/software-mansion/react-native-executorch-qwen-3/resolve/v0.4.0/qwen-3-0.6B/original/qwen3_0_6b_bf16.pte';
26
+ export const QWEN3_0_6B_QUANTIZED =
27
+ 'https://huggingface.co/software-mansion/react-native-executorch-qwen-3/resolve/v0.4.0/qwen-3-0.6B/quantized/qwen3_0_6b_8da4w.pte';
28
+ export const QWEN3_1_7B =
29
+ 'https://huggingface.co/software-mansion/react-native-executorch-qwen-3/resolve/v0.4.0/qwen-3-1.7B/original/qwen3_1_7b_bf16.pte';
30
+ export const QWEN3_1_7B_QUANTIZED =
31
+ 'https://huggingface.co/software-mansion/react-native-executorch-qwen-3/resolve/v0.4.0/qwen-3-1.7B/quantized/qwen3_1_7b_8da4w.pte';
32
+ export const QWEN3_4B =
33
+ 'https://huggingface.co/software-mansion/react-native-executorch-qwen-3/resolve/v0.4.0/qwen-3-4B/original/qwen3_4b_bf16.pte';
34
+ export const QWEN3_4B_QUANTIZED =
35
+ 'https://huggingface.co/software-mansion/react-native-executorch-qwen-3/resolve/v0.4.0/qwen-3-4B/quantized/qwen3_4b_8da4w.pte';
36
+ export const QWEN3_TOKENIZER =
37
+ 'https://huggingface.co/software-mansion/react-native-executorch-qwen-3/resolve/v0.4.0/tokenizer.json';
38
+ export const QWEN3_TOKENIZER_CONFIG =
39
+ 'https://huggingface.co/software-mansion/react-native-executorch-qwen-3/resolve/v0.4.0/tokenizer_config.json';
40
+
41
+ // HAMMER 2.1
42
+ export const HAMMER2_1_0_5B =
43
+ 'https://huggingface.co/software-mansion/react-native-executorch-hammer-2.1/resolve/v0.4.0/hammer-2.1-0.5B/original/hammer2_1_0_5B_bf16.pte';
44
+ export const HAMMER2_1_0_5B_QUANTIZED =
45
+ 'https://huggingface.co/software-mansion/react-native-executorch-hammer-2.1/resolve/v0.4.0/hammer-2.1-0.5B/quantized/hammer2_1_0_5B_8da4w.pte';
46
+ export const HAMMER2_1_1_5B =
47
+ 'https://huggingface.co/software-mansion/react-native-executorch-hammer-2.1/resolve/v0.4.0/hammer-2.1-1.5B/original/hammer2_1_1_5B_bf16.pte';
48
+ export const HAMMER2_1_1_5B_QUANTIZED =
49
+ 'https://huggingface.co/software-mansion/react-native-executorch-hammer-2.1/resolve/v0.4.0/hammer-2.1-1.5B/quantized/hammer2_1_1_5B_8da4w.pte';
50
+ export const HAMMER2_1_3B =
51
+ 'https://huggingface.co/software-mansion/react-native-executorch-hammer-2.1/resolve/v0.4.0/hammer-2.1-3B/original/hammer2_1_3B_bf16.pte';
52
+ export const HAMMER2_1_3B_QUANTIZED =
53
+ 'https://huggingface.co/software-mansion/react-native-executorch-hammer-2.1/resolve/v0.4.0/hammer-2.1-3B/quantized/hammer2_1_3B_8da4w.pte';
54
+ export const HAMMER2_1_TOKENIZER =
55
+ 'https://huggingface.co/software-mansion/react-native-executorch-hammer-2.1/resolve/v0.4.0/tokenizer.json';
56
+ export const HAMMER2_1_TOKENIZER_CONFIG =
57
+ 'https://huggingface.co/software-mansion/react-native-executorch-hammer-2.1/resolve/v0.4.0/tokenizer_config.json';
58
+
59
+ // SMOLLM2
60
+ export const SMOLLM2_1_135M =
61
+ 'https://huggingface.co/software-mansion/react-native-executorch-smolLm-2/resolve/v0.4.0/smolLm-2-135M/original/smolLm2_135M_bf16.pte';
62
+ export const SMOLLM2_1_135M_QUANTIZED =
63
+ 'https://huggingface.co/software-mansion/react-native-executorch-smolLm-2/resolve/v0.4.0/smolLm-2-135M/quantized/smolLm2_135M_8da4w.pte';
64
+ export const SMOLLM2_1_360M =
65
+ 'https://huggingface.co/software-mansion/react-native-executorch-smolLm-2/resolve/v0.4.0/smolLm-2-360M/original/smolLm2_360M_bf16.pte';
66
+ export const SMOLLM2_1_360M_QUANTIZED =
67
+ 'https://huggingface.co/software-mansion/react-native-executorch-smolLm-2/resolve/v0.4.0/smolLm-2-360M/quantized/smolLm2_360M_8da4w.pte';
68
+ export const SMOLLM2_1_1_7B =
69
+ 'https://huggingface.co/software-mansion/react-native-executorch-smolLm-2/resolve/v0.4.0/smolLm-2-1.7B/original/smolLm2_1_7B_bf16.pte';
70
+ export const SMOLLM2_1_1_7B_QUANTIZED =
71
+ 'https://huggingface.co/software-mansion/react-native-executorch-smolLm-2/resolve/v0.4.0/smolLm-2-1.7B/quantized/smolLm2_1_7B_8da4w.pte';
72
+ export const SMOLLM2_1_TOKENIZER =
73
+ 'https://huggingface.co/software-mansion/react-native-executorch-smolLm-2/resolve/v0.4.0/tokenizer.json';
74
+ export const SMOLLM2_1_TOKENIZER_CONFIG =
75
+ 'https://huggingface.co/software-mansion/react-native-executorch-smolLm-2/resolve/v0.4.0/tokenizer_config.json';
76
+
77
+ // QWEN 2.5
78
+ export const QWEN2_5_0_5B =
79
+ 'https://huggingface.co/software-mansion/react-native-executorch-qwen-2.5/resolve/v0.4.0/qwen-2.5-0.5B/original/qwen2_5_0_5b_bf16.pte';
80
+ export const QWEN2_5_0_5B_QUANTIZED =
81
+ 'https://huggingface.co/software-mansion/react-native-executorch-qwen-2.5/resolve/v0.4.0/qwen-2.5-0.5B/quantized/qwen2_5_0_5b_8da4w.pte';
82
+ export const QWEN2_5_1_5B =
83
+ 'https://huggingface.co/software-mansion/react-native-executorch-qwen-2.5/resolve/v0.4.0/qwen-2.5-1.5B/original/qwen2_5_1_5b_bf16.pte';
84
+ export const QWEN2_5_1_5B_QUANTIZED =
85
+ 'https://huggingface.co/software-mansion/react-native-executorch-qwen-2.5/resolve/v0.4.0/qwen-2.5-1.5B/quantized/qwen2_5_1_5b_8da4w.pte';
86
+ export const QWEN2_5_3B =
87
+ 'https://huggingface.co/software-mansion/react-native-executorch-qwen-2.5/resolve/v0.4.0/qwen-2.5-3B/original/qwen2_5_3b_bf16.pte';
88
+ export const QWEN2_5_3B_QUANTIZED =
89
+ 'https://huggingface.co/software-mansion/react-native-executorch-qwen-2.5/resolve/v0.4.0/qwen-2.5-3B/quantized/qwen2_5_3b_8da4w.pte';
90
+ export const QWEN2_5_TOKENIZER =
91
+ 'https://huggingface.co/software-mansion/react-native-executorch-qwen-2.5/resolve/v0.4.0/tokenizer.json';
92
+ export const QWEN2_5_TOKENIZER_CONFIG =
93
+ 'https://huggingface.co/software-mansion/react-native-executorch-qwen-2.5/resolve/v0.4.0/tokenizer_config.json';
94
+
95
+ // PHI 4
96
+ export const PHI_4_MINI_4B =
97
+ 'https://huggingface.co/software-mansion/react-native-executorch-phi-4-mini/resolve/v0.4.0/original/phi-4-mini_bf16.pte';
98
+ export const PHI_4_MINI_4B_QUANTIZED =
99
+ 'https://huggingface.co/software-mansion/react-native-executorch-phi-4-mini/resolve/v0.4.0/quantized/phi-4-mini_8da4w.pte';
100
+ export const PHI_4_MINI_TOKENIZER =
101
+ 'https://huggingface.co/software-mansion/react-native-executorch-phi-4-mini/resolve/v0.4.0/tokenizer.json';
102
+ export const PHI_4_MINI_TOKENIZER_CONFIG =
103
+ 'https://huggingface.co/software-mansion/react-native-executorch-phi-4-mini/resolve/v0.4.0/tokenizer_config.json';
20
104
 
21
105
  // Classification
22
106
  export const EFFICIENTNET_V2_S =
23
107
  Platform.OS === 'ios'
24
- ? 'https://huggingface.co/software-mansion/react-native-executorch-efficientnet-v2-s/resolve/v0.2.0/coreml/efficientnet_v2_s_coreml_all.pte'
25
- : 'https://huggingface.co/software-mansion/react-native-executorch-efficientnet-v2-s/resolve/v0.2.0/xnnpack/efficientnet_v2_s_xnnpack.pte';
108
+ ? 'https://huggingface.co/software-mansion/react-native-executorch-efficientnet-v2-s/resolve/v0.4.0/coreml/efficientnet_v2_s_coreml_all.pte'
109
+ : 'https://huggingface.co/software-mansion/react-native-executorch-efficientnet-v2-s/resolve/v0.4.0/xnnpack/efficientnet_v2_s_xnnpack.pte';
26
110
 
27
111
  // Object detection
28
112
  export const SSDLITE_320_MOBILENET_V3_LARGE =
29
- 'https://huggingface.co/software-mansion/react-native-executorch-ssdlite320-mobilenet-v3-large/resolve/v0.2.0/ssdlite320-mobilenetv3-large.pte';
113
+ 'https://huggingface.co/software-mansion/react-native-executorch-ssdlite320-mobilenet-v3-large/resolve/v0.4.0/ssdlite320-mobilenetv3-large.pte';
30
114
 
31
115
  // Style transfer
32
116
  export const STYLE_TRANSFER_CANDY =
33
117
  Platform.OS === 'ios'
34
- ? 'https://huggingface.co/software-mansion/react-native-executorch-style-transfer-candy/resolve/v0.2.0/coreml/style_transfer_candy_coreml.pte'
35
- : 'https://huggingface.co/software-mansion/react-native-executorch-style-transfer-candy/resolve/v0.2.0/xnnpack/style_transfer_candy_xnnpack.pte';
118
+ ? 'https://huggingface.co/software-mansion/react-native-executorch-style-transfer-candy/resolve/v0.4.0/coreml/style_transfer_candy_coreml.pte'
119
+ : 'https://huggingface.co/software-mansion/react-native-executorch-style-transfer-candy/resolve/v0.4.0/xnnpack/style_transfer_candy_xnnpack.pte';
36
120
  export const STYLE_TRANSFER_MOSAIC =
37
121
  Platform.OS === 'ios'
38
- ? 'https://huggingface.co/software-mansion/react-native-executorch-style-transfer-mosaic/resolve/v0.2.0/coreml/style_transfer_mosaic_coreml.pte'
39
- : 'https://huggingface.co/software-mansion/react-native-executorch-style-transfer-mosaic/resolve/v0.2.0/xnnpack/style_transfer_mosaic_xnnpack.pte';
122
+ ? 'https://huggingface.co/software-mansion/react-native-executorch-style-transfer-mosaic/resolve/v0.4.0/coreml/style_transfer_mosaic_coreml.pte'
123
+ : 'https://huggingface.co/software-mansion/react-native-executorch-style-transfer-mosaic/resolve/v0.4.0/xnnpack/style_transfer_mosaic_xnnpack.pte';
40
124
  export const STYLE_TRANSFER_RAIN_PRINCESS =
41
125
  Platform.OS === 'ios'
42
- ? 'https://huggingface.co/software-mansion/react-native-executorch-style-transfer-rain-princess/resolve/v0.2.0/coreml/style_transfer_rain_princess_coreml.pte'
43
- : 'https://huggingface.co/software-mansion/react-native-executorch-style-transfer-rain-princess/resolve/v0.2.0/xnnpack/style_transfer_rain_princess_xnnpack.pte';
126
+ ? 'https://huggingface.co/software-mansion/react-native-executorch-style-transfer-rain-princess/resolve/v0.4.0/coreml/style_transfer_rain_princess_coreml.pte'
127
+ : 'https://huggingface.co/software-mansion/react-native-executorch-style-transfer-rain-princess/resolve/v0.4.0/xnnpack/style_transfer_rain_princess_xnnpack.pte';
44
128
  export const STYLE_TRANSFER_UDNIE =
45
129
  Platform.OS === 'ios'
46
- ? 'https://huggingface.co/software-mansion/react-native-executorch-style-transfer-udnie/resolve/v0.2.0/coreml/style_transfer_udnie_coreml.pte'
47
- : 'https://huggingface.co/software-mansion/react-native-executorch-style-transfer-udnie/resolve/v0.2.0/xnnpack/style_transfer_udnie_xnnpack.pte';
130
+ ? 'https://huggingface.co/software-mansion/react-native-executorch-style-transfer-udnie/resolve/v0.4.0/coreml/style_transfer_udnie_coreml.pte'
131
+ : 'https://huggingface.co/software-mansion/react-native-executorch-style-transfer-udnie/resolve/v0.4.0/xnnpack/style_transfer_udnie_xnnpack.pte';
48
132
 
49
133
  // S2T
50
134
  export const MOONSHINE_TINY_DECODER =
51
- 'https://huggingface.co/software-mansion/react-native-executorch-moonshine-tiny/resolve/v0.3.0/xnnpack/moonshine_tiny_xnnpack_decoder.pte';
135
+ 'https://huggingface.co/software-mansion/react-native-executorch-moonshine-tiny/resolve/v0.4.0/xnnpack/moonshine_tiny_xnnpack_decoder.pte';
52
136
  export const MOONSHINE_TINY_ENCODER =
53
- 'https://huggingface.co/software-mansion/react-native-executorch-moonshine-tiny/resolve/v0.3.0/xnnpack/moonshine_tiny_xnnpack_encoder.pte';
137
+ 'https://huggingface.co/software-mansion/react-native-executorch-moonshine-tiny/resolve/v0.4.0/xnnpack/moonshine_tiny_xnnpack_encoder.pte';
54
138
  export const MOONSHINE_TOKENIZER =
55
- 'https://huggingface.co/software-mansion/react-native-executorch-moonshine-tiny/resolve/v0.3.0/moonshine_tiny_tokenizer.json';
139
+ 'https://huggingface.co/software-mansion/react-native-executorch-moonshine-tiny/resolve/v0.4.0/moonshine_tiny_tokenizer.json';
56
140
  export const WHISPER_TOKENIZER =
57
- 'https://huggingface.co/software-mansion/react-native-executorch-whisper-tiny.en/resolve/v0.3.0/whisper_tokenizer.json';
141
+ 'https://huggingface.co/software-mansion/react-native-executorch-whisper-tiny.en/resolve/v0.4.0/whisper_tokenizer.json';
58
142
  export const WHISPER_TINY_DECODER =
59
- 'https://huggingface.co/software-mansion/react-native-executorch-whisper-tiny.en/resolve/v0.3.0/xnnpack/whisper_tiny_en_xnnpack_decoder.pte';
143
+ 'https://huggingface.co/software-mansion/react-native-executorch-whisper-tiny.en/resolve/v0.4.0/xnnpack/whisper_tiny_en_xnnpack_decoder.pte';
60
144
  export const WHISPER_TINY_ENCODER =
61
- 'https://huggingface.co/software-mansion/react-native-executorch-whisper-tiny.en/resolve/v0.3.0/xnnpack/whisper_tiny_en_xnnpack_encoder.pte';
145
+ 'https://huggingface.co/software-mansion/react-native-executorch-whisper-tiny.en/resolve/v0.4.0/xnnpack/whisper_tiny_en_xnnpack_encoder.pte';
146
+ export const WHISPER_TINY_MULTILINGUAL_ENCODER =
147
+ 'https://huggingface.co/software-mansion/react-native-executorch-whisper-tiny/resolve/v0.4.0/xnnpack/xnnpack_whisper_encoder.pte';
148
+ export const WHISPER_TINY_MULTILINGUAL_DECODER =
149
+ 'https://huggingface.co/software-mansion/react-native-executorch-whisper-tiny/resolve/v0.4.0/xnnpack/xnnpack_whisper_decoder.pte';
150
+ export const WHISPER_TINY_MULTILINGUAL_TOKENIZER =
151
+ 'https://huggingface.co/software-mansion/react-native-executorch-whisper-tiny/resolve/v0.4.0/tokenizer.json';
62
152
 
63
153
  // OCR
64
-
65
154
  export const DETECTOR_CRAFT_1280 =
66
- 'https://huggingface.co/software-mansion/react-native-executorch-detector-craft/resolve/v0.3.0/xnnpack/xnnpack_craft_1280.pte';
155
+ 'https://huggingface.co/software-mansion/react-native-executorch-detector-craft/resolve/v0.4.0/xnnpack/xnnpack_craft_1280.pte';
67
156
  export const DETECTOR_CRAFT_800 =
68
- 'https://huggingface.co/software-mansion/react-native-executorch-detector-craft/resolve/v0.3.0/xnnpack/xnnpack_craft_800.pte';
157
+ 'https://huggingface.co/software-mansion/react-native-executorch-detector-craft/resolve/v0.4.0/xnnpack/xnnpack_craft_800.pte';
69
158
  export const DETECTOR_CRAFT_320 =
70
- 'https://huggingface.co/software-mansion/react-native-executorch-detector-craft/resolve/v0.3.0/xnnpack/xnnpack_craft_320.pte';
159
+ 'https://huggingface.co/software-mansion/react-native-executorch-detector-craft/resolve/v0.4.0/xnnpack/xnnpack_craft_320.pte';
160
+
161
+ // Image segmentation
162
+ export const DEEPLAB_V3_RESNET50 =
163
+ 'https://huggingface.co/software-mansion/react-native-executorch-deeplab-v3/resolve/v0.4.0/xnnpack/deeplabV3_xnnpack_fp32.pte';
164
+
165
+ // Text Embeddings
166
+ export const ALL_MINILM_L6_V2 =
167
+ 'https://huggingface.co/software-mansion/react-native-executorch-all-MiniLM-L6-v2/resolve/v0.4.0/all-MiniLM-L6-v2_xnnpack.pte';
168
+ export const ALL_MINILM_L6_V2_TOKENIZER =
169
+ 'https://huggingface.co/software-mansion/react-native-executorch-all-MiniLM-L6-v2/resolve/v0.4.0/tokenizer.json';
170
+
171
+ export const ALL_MPNET_BASE_V2 =
172
+ 'https://huggingface.co/software-mansion/react-native-executorch-all-mpnet-base-v2/resolve/v0.4.0/all-mpnet-base-v2_xnnpack.pte';
173
+ export const ALL_MPNET_BASE_V2_TOKENIZER =
174
+ 'https://huggingface.co/software-mansion/react-native-executorch-all-mpnet-base-v2/resolve/v0.4.0/tokenizer.json';
175
+
176
+ export const MULTI_QA_MINILM_L6_COS_V1 =
177
+ 'https://huggingface.co/software-mansion/react-native-executorch-multi-qa-MiniLM-L6-cos-v1/resolve/v0.4.0/multi-qa-MiniLM-L6-cos-v1_xnnpack.pte';
178
+ export const MULTI_QA_MINILM_L6_COS_V1_TOKENIZER =
179
+ 'https://huggingface.co/software-mansion/react-native-executorch-multi-qa-MiniLM-L6-cos-v1/resolve/v0.4.0/tokenizer.json';
71
180
 
72
- export const RECOGNIZER_EN_CRNN_512 =
73
- 'https://huggingface.co/software-mansion/react-native-executorch-recognizer-crnn.en/resolve/v0.3.0/xnnpack/xnnpack_crnn_en_512.pte';
74
- export const RECOGNIZER_EN_CRNN_256 =
75
- 'https://huggingface.co/software-mansion/react-native-executorch-recognizer-crnn.en/resolve/v0.3.0/xnnpack/xnnpack_crnn_en_256.pte';
76
- export const RECOGNIZER_EN_CRNN_128 =
77
- 'https://huggingface.co/software-mansion/react-native-executorch-recognizer-crnn.en/resolve/v0.3.0/xnnpack/xnnpack_crnn_en_128.pte';
78
- export const RECOGNIZER_EN_CRNN_64 =
79
- 'https://huggingface.co/software-mansion/react-native-executorch-recognizer-crnn.en/resolve/v0.3.0/xnnpack/xnnpack_crnn_en_64.pte';
181
+ export const MULTI_QA_MPNET_BASE_DOT_V1 =
182
+ 'https://huggingface.co/software-mansion/react-native-executorch-multi-qa-mpnet-base-dot-v1/resolve/v0.4.0/multi-qa-mpnet-base-dot-v1_xnnpack.pte';
183
+ export const MULTI_QA_MPNET_BASE_DOT_V1_TOKENIZER =
184
+ 'https://huggingface.co/software-mansion/react-native-executorch-multi-qa-mpnet-base-dot-v1/resolve/v0.4.0/tokenizer.json';
80
185
 
81
186
  // Backward compatibility
82
187
  export const LLAMA3_2_3B_URL = LLAMA3_2_3B;
@@ -85,3 +190,5 @@ export const LLAMA3_2_3B_SPINQUANT_URL = LLAMA3_2_3B_SPINQUANT;
85
190
  export const LLAMA3_2_1B_URL = LLAMA3_2_1B;
86
191
  export const LLAMA3_2_1B_QLORA_URL = LLAMA3_2_1B_QLORA;
87
192
  export const LLAMA3_2_1B_SPINQUANT_URL = LLAMA3_2_1B_SPINQUANT;
193
+ export const LLAMA3_2_1B_TOKENIZER = LLAMA3_2_TOKENIZER;
194
+ export const LLAMA3_2_3B_TOKENIZER = LLAMA3_2_TOKENIZER;