react-native-executorch 0.5.6 → 0.5.8

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 (237) hide show
  1. package/android/libs/classes.jar +0 -0
  2. package/android/src/main/cpp/CMakeLists.txt +23 -14
  3. package/common/rnexecutorch/RnExecutorchInstaller.cpp +4 -21
  4. package/common/rnexecutorch/host_objects/ModelHostObject.h +67 -51
  5. package/common/rnexecutorch/models/llm/LLM.cpp +24 -1
  6. package/common/rnexecutorch/models/llm/LLM.h +4 -1
  7. package/common/rnexecutorch/threads/GlobalThreadPool.h +79 -0
  8. package/common/rnexecutorch/threads/HighPerformanceThreadPool.h +364 -0
  9. package/common/rnexecutorch/threads/utils/ThreadUtils.h +29 -0
  10. package/common/runner/runner.cpp +9 -3
  11. package/common/runner/runner.h +4 -3
  12. package/common/runner/text_token_generator.h +28 -10
  13. package/lib/Error.js +53 -0
  14. package/lib/ThreadPool.d.ts +10 -0
  15. package/lib/ThreadPool.js +28 -0
  16. package/lib/common/Logger.d.ts +8 -0
  17. package/lib/common/Logger.js +19 -0
  18. package/lib/constants/directories.js +2 -0
  19. package/lib/constants/llmDefaults.d.ts +6 -0
  20. package/lib/constants/llmDefaults.js +16 -0
  21. package/lib/constants/modelUrls.d.ts +223 -0
  22. package/lib/constants/modelUrls.js +322 -0
  23. package/lib/constants/ocr/models.d.ts +882 -0
  24. package/lib/constants/ocr/models.js +182 -0
  25. package/lib/constants/ocr/symbols.js +139 -0
  26. package/lib/constants/sttDefaults.d.ts +28 -0
  27. package/lib/constants/sttDefaults.js +68 -0
  28. package/lib/controllers/LLMController.d.ts +47 -0
  29. package/lib/controllers/LLMController.js +213 -0
  30. package/lib/controllers/OCRController.js +67 -0
  31. package/lib/controllers/SpeechToTextController.d.ts +56 -0
  32. package/lib/controllers/SpeechToTextController.js +349 -0
  33. package/lib/controllers/VerticalOCRController.js +70 -0
  34. package/lib/hooks/computer_vision/useClassification.d.ts +15 -0
  35. package/lib/hooks/computer_vision/useClassification.js +7 -0
  36. package/lib/hooks/computer_vision/useImageEmbeddings.d.ts +15 -0
  37. package/lib/hooks/computer_vision/useImageEmbeddings.js +7 -0
  38. package/lib/hooks/computer_vision/useImageSegmentation.d.ts +38 -0
  39. package/lib/hooks/computer_vision/useImageSegmentation.js +7 -0
  40. package/lib/hooks/computer_vision/useOCR.d.ts +20 -0
  41. package/lib/hooks/computer_vision/useOCR.js +41 -0
  42. package/lib/hooks/computer_vision/useObjectDetection.d.ts +15 -0
  43. package/lib/hooks/computer_vision/useObjectDetection.js +7 -0
  44. package/lib/hooks/computer_vision/useStyleTransfer.d.ts +15 -0
  45. package/lib/hooks/computer_vision/useStyleTransfer.js +7 -0
  46. package/lib/hooks/computer_vision/useVerticalOCR.d.ts +21 -0
  47. package/lib/hooks/computer_vision/useVerticalOCR.js +43 -0
  48. package/lib/hooks/general/useExecutorchModule.d.ts +13 -0
  49. package/lib/hooks/general/useExecutorchModule.js +7 -0
  50. package/lib/hooks/natural_language_processing/useLLM.d.ts +10 -0
  51. package/lib/hooks/natural_language_processing/useLLM.js +78 -0
  52. package/lib/hooks/natural_language_processing/useSpeechToText.d.ts +27 -0
  53. package/lib/hooks/natural_language_processing/useSpeechToText.js +49 -0
  54. package/lib/hooks/natural_language_processing/useTextEmbeddings.d.ts +16 -0
  55. package/lib/hooks/natural_language_processing/useTextEmbeddings.js +7 -0
  56. package/lib/hooks/natural_language_processing/useTokenizer.d.ts +17 -0
  57. package/lib/hooks/natural_language_processing/useTokenizer.js +52 -0
  58. package/lib/hooks/useModule.js +45 -0
  59. package/lib/hooks/useNonStaticModule.d.ts +20 -0
  60. package/lib/hooks/useNonStaticModule.js +49 -0
  61. package/lib/index.d.ts +48 -0
  62. package/lib/index.js +58 -0
  63. package/lib/module/controllers/LLMController.js +21 -2
  64. package/lib/module/controllers/LLMController.js.map +1 -1
  65. package/lib/module/hooks/natural_language_processing/useLLM.js +6 -2
  66. package/lib/module/hooks/natural_language_processing/useLLM.js.map +1 -1
  67. package/lib/module/modules/natural_language_processing/LLMModule.js +7 -2
  68. package/lib/module/modules/natural_language_processing/LLMModule.js.map +1 -1
  69. package/lib/module/types/llm.js.map +1 -1
  70. package/lib/modules/BaseModule.js +25 -0
  71. package/lib/modules/BaseNonStaticModule.js +14 -0
  72. package/lib/modules/computer_vision/ClassificationModule.d.ts +8 -0
  73. package/lib/modules/computer_vision/ClassificationModule.js +17 -0
  74. package/lib/modules/computer_vision/ImageEmbeddingsModule.d.ts +8 -0
  75. package/lib/modules/computer_vision/ImageEmbeddingsModule.js +17 -0
  76. package/lib/modules/computer_vision/ImageSegmentationModule.d.ts +11 -0
  77. package/lib/modules/computer_vision/ImageSegmentationModule.js +27 -0
  78. package/lib/modules/computer_vision/OCRModule.d.ts +14 -0
  79. package/lib/modules/computer_vision/OCRModule.js +17 -0
  80. package/lib/modules/computer_vision/ObjectDetectionModule.d.ts +9 -0
  81. package/lib/modules/computer_vision/ObjectDetectionModule.js +17 -0
  82. package/lib/modules/computer_vision/StyleTransferModule.d.ts +8 -0
  83. package/lib/modules/computer_vision/StyleTransferModule.js +17 -0
  84. package/lib/modules/computer_vision/VerticalOCRModule.d.ts +14 -0
  85. package/lib/modules/computer_vision/VerticalOCRModule.js +19 -0
  86. package/lib/modules/general/ExecutorchModule.d.ts +7 -0
  87. package/lib/modules/general/ExecutorchModule.js +14 -0
  88. package/lib/modules/natural_language_processing/LLMModule.d.ts +28 -0
  89. package/lib/modules/natural_language_processing/LLMModule.js +45 -0
  90. package/lib/modules/natural_language_processing/SpeechToTextModule.d.ts +24 -0
  91. package/lib/modules/natural_language_processing/SpeechToTextModule.js +36 -0
  92. package/lib/modules/natural_language_processing/TextEmbeddingsModule.d.ts +9 -0
  93. package/lib/modules/natural_language_processing/TextEmbeddingsModule.js +21 -0
  94. package/lib/modules/natural_language_processing/TokenizerModule.d.ts +12 -0
  95. package/lib/modules/natural_language_processing/TokenizerModule.js +30 -0
  96. package/lib/native/NativeETInstaller.js +2 -0
  97. package/lib/native/NativeOCR.js +2 -0
  98. package/lib/native/NativeVerticalOCR.js +2 -0
  99. package/lib/native/RnExecutorchModules.d.ts +7 -0
  100. package/lib/native/RnExecutorchModules.js +18 -0
  101. package/lib/tsconfig.tsbuildinfo +1 -0
  102. package/lib/types/common.d.ts +32 -0
  103. package/lib/types/common.js +25 -0
  104. package/lib/types/imageSegmentation.js +26 -0
  105. package/lib/types/llm.d.ts +46 -0
  106. package/lib/types/llm.js +9 -0
  107. package/lib/types/objectDetection.js +94 -0
  108. package/lib/types/ocr.js +1 -0
  109. package/lib/types/stt.d.ts +94 -0
  110. package/lib/types/stt.js +85 -0
  111. package/lib/typescript/controllers/LLMController.d.ts +4 -2
  112. package/lib/typescript/controllers/LLMController.d.ts.map +1 -1
  113. package/lib/typescript/hooks/natural_language_processing/useLLM.d.ts.map +1 -1
  114. package/lib/typescript/modules/natural_language_processing/LLMModule.d.ts +4 -2
  115. package/lib/typescript/modules/natural_language_processing/LLMModule.d.ts.map +1 -1
  116. package/lib/typescript/types/llm.d.ts +7 -1
  117. package/lib/typescript/types/llm.d.ts.map +1 -1
  118. package/lib/utils/ResourceFetcher.d.ts +24 -0
  119. package/lib/utils/ResourceFetcher.js +305 -0
  120. package/lib/utils/ResourceFetcherUtils.d.ts +54 -0
  121. package/lib/utils/ResourceFetcherUtils.js +127 -0
  122. package/lib/utils/llm.d.ts +6 -0
  123. package/lib/utils/llm.js +72 -0
  124. package/lib/utils/stt.js +21 -0
  125. package/package.json +3 -1
  126. package/react-native-executorch.podspec +12 -31
  127. package/src/controllers/LLMController.ts +29 -5
  128. package/src/hooks/natural_language_processing/useLLM.ts +15 -1
  129. package/src/modules/natural_language_processing/LLMModule.ts +14 -2
  130. package/src/types/llm.ts +8 -0
  131. package/third-party/android/libs/cpuinfo/arm64-v8a/libcpuinfo.so +0 -0
  132. package/third-party/android/libs/executorch/arm64-v8a/libexecutorch.so +0 -0
  133. package/third-party/android/libs/executorch/x86_64/libexecutorch.so +0 -0
  134. package/third-party/android/libs/pthreadpool/arm64-v8a/libpthreadpool.so +0 -0
  135. package/third-party/android/libs/tokenizers-cpp/arm64-v8a/libsentencepiece.a +0 -0
  136. package/third-party/android/libs/tokenizers-cpp/arm64-v8a/libtokenizers_c.a +0 -0
  137. package/third-party/android/libs/tokenizers-cpp/arm64-v8a/libtokenizers_cpp.a +0 -0
  138. package/third-party/android/libs/tokenizers-cpp/x86_64/libsentencepiece.a +0 -0
  139. package/third-party/android/libs/tokenizers-cpp/x86_64/libtokenizers_c.a +0 -0
  140. package/third-party/android/libs/tokenizers-cpp/x86_64/libtokenizers_cpp.a +0 -0
  141. package/third-party/include/c10/macros/Export.h +2 -86
  142. package/third-party/include/c10/macros/Macros.h +28 -5
  143. package/third-party/include/c10/util/BFloat16-inl.h +1 -4
  144. package/third-party/include/c10/util/BFloat16.h +5 -8
  145. package/third-party/include/c10/util/Half.h +5 -0
  146. package/third-party/include/c10/util/bit_cast.h +1 -1
  147. package/third-party/include/c10/util/complex.h +639 -0
  148. package/third-party/include/c10/util/complex_math.h +399 -0
  149. package/third-party/include/c10/util/complex_utils.h +41 -0
  150. package/third-party/include/c10/util/irange.h +2 -2
  151. package/third-party/include/c10/util/overflows.h +95 -0
  152. package/third-party/include/executorch/ExecuTorchError.h +75 -0
  153. package/third-party/include/executorch/ExecuTorchModule.h +115 -11
  154. package/third-party/include/executorch/ExecuTorchTensor.h +731 -51
  155. package/third-party/include/executorch/ExecuTorchValue.h +61 -9
  156. package/third-party/include/executorch/extension/kernel_util/make_boxed_from_unboxed_functor.h +181 -0
  157. package/third-party/include/executorch/extension/kernel_util/meta_programming.h +108 -0
  158. package/third-party/include/executorch/extension/kernel_util/type_list.h +137 -0
  159. package/third-party/include/executorch/extension/module/bundled_module.h +131 -0
  160. package/third-party/include/executorch/extension/module/module.h +46 -20
  161. package/third-party/include/executorch/extension/threadpool/cpuinfo_utils.h +1 -3
  162. package/third-party/include/executorch/extension/threadpool/threadpool.h +1 -3
  163. package/third-party/include/executorch/extension/threadpool/threadpool_guard.h +35 -0
  164. package/third-party/include/executorch/runtime/backend/backend_execution_context.h +3 -3
  165. package/third-party/include/executorch/runtime/backend/backend_init_context.h +12 -6
  166. package/third-party/include/executorch/runtime/backend/backend_option_context.h +34 -0
  167. package/third-party/include/executorch/runtime/backend/interface.h +70 -9
  168. package/third-party/include/executorch/runtime/backend/options.h +206 -0
  169. package/third-party/include/executorch/runtime/core/evalue.h +19 -25
  170. package/third-party/include/executorch/runtime/core/event_tracer.h +32 -17
  171. package/third-party/include/executorch/runtime/core/event_tracer_hooks.h +23 -14
  172. package/third-party/include/executorch/runtime/core/exec_aten/exec_aten.h +32 -9
  173. package/third-party/include/executorch/runtime/core/exec_aten/util/dim_order_util.h +3 -2
  174. package/third-party/include/executorch/runtime/core/exec_aten/util/scalar_type_util.h +43 -75
  175. package/third-party/include/executorch/runtime/core/exec_aten/util/tensor_util.h +88 -87
  176. package/third-party/include/executorch/runtime/core/function_ref.h +100 -0
  177. package/third-party/include/executorch/runtime/core/named_data_map.h +14 -14
  178. package/third-party/include/executorch/runtime/core/portable_type/c10/c10/macros/Export.h +2 -86
  179. package/third-party/include/executorch/runtime/core/portable_type/c10/c10/macros/Macros.h +28 -5
  180. package/third-party/include/executorch/runtime/core/portable_type/c10/c10/util/BFloat16-inl.h +1 -4
  181. package/third-party/include/executorch/runtime/core/portable_type/c10/c10/util/BFloat16.h +5 -8
  182. package/third-party/include/executorch/runtime/core/portable_type/c10/c10/util/Half.h +5 -0
  183. package/third-party/include/executorch/runtime/core/portable_type/c10/c10/util/bit_cast.h +1 -1
  184. package/third-party/include/executorch/runtime/core/portable_type/c10/c10/util/complex.h +639 -0
  185. package/third-party/include/executorch/runtime/core/portable_type/c10/c10/util/complex_math.h +399 -0
  186. package/third-party/include/executorch/runtime/core/portable_type/c10/c10/util/complex_utils.h +41 -0
  187. package/third-party/include/executorch/runtime/core/portable_type/c10/c10/util/irange.h +2 -2
  188. package/third-party/include/executorch/runtime/core/portable_type/c10/c10/util/overflows.h +95 -0
  189. package/third-party/include/executorch/runtime/core/portable_type/c10/torch/headeronly/macros/Export.h +88 -0
  190. package/third-party/include/executorch/runtime/core/portable_type/complex.h +6 -29
  191. package/third-party/include/executorch/runtime/core/portable_type/tensor_impl.h +20 -0
  192. package/third-party/include/executorch/runtime/core/span.h +4 -0
  193. package/third-party/include/executorch/runtime/core/tag.h +19 -0
  194. package/third-party/include/executorch/runtime/core/tensor_layout.h +2 -2
  195. package/third-party/include/executorch/runtime/executor/method.h +15 -3
  196. package/third-party/include/executorch/runtime/executor/method_meta.h +34 -5
  197. package/third-party/include/executorch/runtime/executor/program.h +3 -4
  198. package/third-party/include/executorch/runtime/executor/pte_data_map.h +9 -8
  199. package/third-party/include/executorch/runtime/executor/tensor_parser.h +14 -13
  200. package/third-party/include/executorch/runtime/kernel/kernel_runtime_context.h +5 -5
  201. package/third-party/include/executorch/runtime/kernel/operator_registry.h +21 -19
  202. package/third-party/include/executorch/runtime/platform/compiler.h +8 -0
  203. package/third-party/include/executorch/runtime/platform/platform.h +126 -0
  204. package/third-party/include/headeronly/macros/Export.h +88 -0
  205. package/third-party/include/tokenizers-cpp/tokenizers_c.h +61 -0
  206. package/third-party/include/torch/headeronly/macros/Export.h +88 -0
  207. package/third-party/ios/ExecutorchLib.xcframework/Info.plist +43 -0
  208. package/third-party/ios/ExecutorchLib.xcframework/ios-arm64/ExecutorchLib.framework/ExecutorchLib +0 -0
  209. package/third-party/ios/ExecutorchLib.xcframework/ios-arm64/ExecutorchLib.framework/Info.plist +0 -0
  210. package/third-party/ios/ExecutorchLib.xcframework/ios-arm64-simulator/ExecutorchLib.framework/ExecutorchLib +0 -0
  211. package/third-party/ios/ExecutorchLib.xcframework/ios-arm64-simulator/ExecutorchLib.framework/Info.plist +0 -0
  212. package/third-party/ios/libs/cpuinfo/libcpuinfo.a +0 -0
  213. package/third-party/ios/libs/pthreadpool/physical-arm64-release/libpthreadpool.a +0 -0
  214. package/third-party/ios/libs/pthreadpool/simulator-arm64-debug/libpthreadpool.a +0 -0
  215. package/ios/libs/executorch/libbackend_coreml_ios.a +0 -0
  216. package/ios/libs/executorch/libbackend_coreml_simulator.a +0 -0
  217. package/ios/libs/executorch/libbackend_mps_ios.a +0 -0
  218. package/ios/libs/executorch/libbackend_mps_simulator.a +0 -0
  219. package/ios/libs/executorch/libbackend_xnnpack_ios.a +0 -0
  220. package/ios/libs/executorch/libbackend_xnnpack_simulator.a +0 -0
  221. package/ios/libs/executorch/libexecutorch_ios.a +0 -0
  222. package/ios/libs/executorch/libexecutorch_simulator.a +0 -0
  223. package/ios/libs/executorch/libkernels_custom_ios.a +0 -0
  224. package/ios/libs/executorch/libkernels_custom_simulator.a +0 -0
  225. package/ios/libs/executorch/libkernels_optimized_ios.a +0 -0
  226. package/ios/libs/executorch/libkernels_optimized_simulator.a +0 -0
  227. package/ios/libs/executorch/libkernels_portable_ios.a +0 -0
  228. package/ios/libs/executorch/libkernels_portable_simulator.a +0 -0
  229. package/ios/libs/executorch/libkernels_quantized_ios.a +0 -0
  230. package/ios/libs/executorch/libkernels_quantized_simulator.a +0 -0
  231. package/third-party/ios/ios.toolchain.cmake +0 -1122
  232. /package/{ios → third-party/ios}/libs/tokenizers-cpp/physical-arm64-release/libsentencepiece.a +0 -0
  233. /package/{ios → third-party/ios}/libs/tokenizers-cpp/physical-arm64-release/libtokenizers_c.a +0 -0
  234. /package/{ios → third-party/ios}/libs/tokenizers-cpp/physical-arm64-release/libtokenizers_cpp.a +0 -0
  235. /package/{ios → third-party/ios}/libs/tokenizers-cpp/simulator-arm64-debug/libsentencepiece.a +0 -0
  236. /package/{ios → third-party/ios}/libs/tokenizers-cpp/simulator-arm64-debug/libtokenizers_c.a +0 -0
  237. /package/{ios → third-party/ios}/libs/tokenizers-cpp/simulator-arm64-debug/libtokenizers_cpp.a +0 -0