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

ANR Triggered when processing a large prompt. #369

Open
alexcontor opened this issue Apr 4, 2024 · 0 comments
Open

ANR Triggered when processing a large prompt. #369

alexcontor opened this issue Apr 4, 2024 · 0 comments

Comments

@alexcontor
Copy link

Both com/google/mediapipe/tasks/genai/llminference/LlmInference#generateResponse and com/google/mediapipe/tasks/genai/llminference/LlmInference#generateResponseAsync methods freeze the Main Thread if the prompt provided is very long (1000 Tokens).

Wrapping the call in a async thread doesn't seem to work:

ExecutorService executor = Executors.newSingleThreadExecutor();
executor.execute(() -> {
       llmInference.generateResponseAsync(LARGE_PROMPT);
 });
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