Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 [meidiapipe_text] Null check failed by cosineSimilarity #65

Open
youngjun-k opened this issue Jun 22, 2024 · 0 comments
Open

🐛 [meidiapipe_text] Null check failed by cosineSimilarity #65

youngjun-k opened this issue Jun 22, 2024 · 0 comments

Comments

@youngjun-k
Copy link

youngjun-k commented Jun 22, 2024

OS: Apple Silicon(ARM) Mac OS
Test Device: Android Emulator

It seems like the embedding pointer becomes null If It is not created from the embedder.

final textEumbedResult = await embedder.embed(text);

final embedding = Embedding.float(
            Float32List.fromList(te),
            headIndex: 1,
 );

final similarity = await embedder.cosineSimilarity(
            textEumbedResult.embeddings.first,
            embedding,
  );  

print("similarity: $similarity");

E/flutter ( 6844): Null check operator used on a null value
E/flutter ( 6844): #0 _embedderService (package:mediapipe_text/src/io/tasks/text_embedding/text_embedder.dart:124:55)

case _EmbedderTaskType._cosineSimilarity:
          p.send(
            executor.cosineSimilarity(
              (message.a as core_io.Embedding).pointer!,
              (message.b as core_io.Embedding).pointer!,
            ),
          );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant