File tree Expand file tree Collapse file tree 4 files changed +5
-4
lines changed
packages/react-native-executorch
common/rnexecutorch/models/text_to_image Expand file tree Collapse file tree 4 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ std::vector<float> Encoder::generate(std::string input) {
2020 std::shared_ptr<OwningArrayBuffer> embeddingsUncond =
2121 encoder->generate (std::string (constants::kBosToken ));
2222
23+ assert (embeddingsText->size () == embeddingsUncond->size ());
2324 size_t embeddingsSize = embeddingsText->size () / sizeof (float );
2425 auto *embeddingsTextPtr = reinterpret_cast <float *>(embeddingsText->data ());
2526 auto *embeddingsUncondPtr =
Original file line number Diff line number Diff line change @@ -97,7 +97,7 @@ TextToImage::postprocess(const std::vector<float> &output) const {
9797 outputRgb[i * 4 + 3 ] = 255 ;
9898 }
9999
100- // Replace with a function when #584 implemented
100+ // TODO: Replace with a function when #584 implemented
101101 auto createBuffer = [](const auto &data, size_t size) {
102102 auto buffer = std::make_shared<OwningArrayBuffer>(size);
103103 std::memcpy (buffer->data (), data, size);
@@ -106,7 +106,7 @@ TextToImage::postprocess(const std::vector<float> &output) const {
106106 return createBuffer (outputRgb.data (), outputRgb.size () * sizeof (float ));
107107}
108108
109- void TextToImage::interrupt () { interrupted = true ; }
109+ void TextToImage::interrupt () noexcept { interrupted = true ; }
110110
111111size_t TextToImage::getMemoryLowerBound () const noexcept {
112112 return encoder->getMemoryLowerBound () + unet->getMemoryLowerBound () +
Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ class TextToImage final {
3232 std::shared_ptr<OwningArrayBuffer>
3333 generate (std::string input, size_t numInferenceSteps,
3434 std::shared_ptr<jsi::Function> callback);
35- void interrupt ();
35+ void interrupt () noexcept ;
3636 size_t getMemoryLowerBound () const noexcept ;
3737 void unload () noexcept ;
3838
Original file line number Diff line number Diff line change @@ -424,7 +424,7 @@ export const CLIP_VIT_BASE_PATCH32_TEXT = {
424424} ;
425425
426426// Image generation
427- export const BK_SDM_TINY_VPRED = {
427+ export const BK_SDM_TINY_VPRED_512 = {
428428 schedulerSource :
429429 'https://huggingface.co/aszymanska/bk-sdm-tiny-vpred/resolve/main/scheduler/scheduler_config.json' ,
430430 tokenizerSource :
You can’t perform that action at this time.
0 commit comments