Skip to content

Commit cd2f863

Browse files
committed
fix: expose unload() JSI binding for TextToImageModule
TextToImage.unload() exists in C++ but was never registered as a JSI host function, causing `TypeError: this.nativeModule.unload is not a function` when calling BaseModule.delete() from JS. Every other composite model (OCR, VerticalOCR, Kokoro, LLM) already registers unload in its `if constexpr` block — this adds the same one-liner for TextToImage.
1 parent fdbd3e9 commit cd2f863

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

packages/react-native-executorch/common/rnexecutorch/host_objects/ModelHostObject.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,8 @@ template <typename Model> class ModelHostObject : public JsiHostObject {
148148
}
149149

150150
if constexpr (meta::SameAs<Model, models::text_to_image::TextToImage>) {
151+
addFunctions(
152+
JSI_EXPORT_FUNCTION(ModelHostObject<Model>, unload, "unload"));
151153
addFunctions(JSI_EXPORT_FUNCTION(
152154
ModelHostObject<Model>, synchronousHostFunction<&Model::interrupt>,
153155
"interrupt"));

0 commit comments

Comments
 (0)