Skip to content

Commit 8560b53

Browse files
committed
chore: add TokenizerModule to RnExecutorchInstaller
1 parent cc7137b commit 8560b53

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

packages/react-native-executorch/common/rnexecutorch/RnExecutorchInstaller.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#include "RnExecutorchInstaller.h"
22

3+
#include <rnexecutorch/TokenizerModule.h>
34
#include <rnexecutorch/host_objects/JsiConversions.h>
45
#include <rnexecutorch/models/classification/Classification.h>
56
#include <rnexecutorch/models/image_segmentation/ImageSegmentation.h>
@@ -42,6 +43,11 @@ void RnExecutorchInstaller::injectJSIBindings(
4243
*jsiRuntime, "loadExecutorchModule",
4344
RnExecutorchInstaller::loadModel<BaseModel>(jsiRuntime, jsCallInvoker,
4445
"loadExecutorchModule"));
46+
47+
jsiRuntime->global().setProperty(
48+
*jsiRuntime, "loadTokenizerModule",
49+
RnExecutorchInstaller::loadModel<TokenizerModule>(
50+
jsiRuntime, jsCallInvoker, "loadTokenizerModule"));
4551
}
4652

4753
} // namespace rnexecutorch

packages/react-native-executorch/common/rnexecutorch/RnExecutorchInstaller.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class RnExecutorchInstaller {
2626
FetchUrlFunc_t fetchDataFromUrl);
2727

2828
private:
29-
template <DerivedFromOrSameAs<BaseModel> ModelT>
29+
template <typename ModelT>
3030
static jsi::Function
3131
loadModel(jsi::Runtime *jsiRuntime,
3232
std::shared_ptr<react::CallInvoker> jsCallInvoker,

0 commit comments

Comments
 (0)