google-ai-edge / mediapipe

Cross-platform, customizable ML solutions for live and streaming media.
https://ai.google.dev/edge/mediapipe
Apache License 2.0
27.69k stars 5.18k forks source link

MediaPipe error in Chrome (requestAdapterInfo) #5739

Closed maudnals closed 3 days ago

maudnals commented 4 days ago

Have I written custom code (as opposed to using a stock example script provided in MediaPipe)

No

OS Platform and Distribution

MacOS Sonoma 14.7

Mobile device if the issue happens on mobile device

No response

Browser and version if the issue happens on browser

Chrome 131.0.6778.69

Programming Language and version

JavaScript

MediaPipe version

@mediapipe/tasks-genai": ^0.10.18

Bazel version

No response

Solution

MediaPipe LLM Inference API

Android Studio, NDK, SDK versions (if issue is related to building in Android environment)

No response

Xcode & Tulsi version (if issue is related to building for iOS)

No response

Describe the actual behavior

TypeError: n.requestAdapterInfo is not a function

Describe the expected behaviour

The Gen AI task runs properly

Standalone code/steps you may have used to try to get what you need

Refer to the bug reproduction: https://github.com/maudnals/mediapipe-request-adapter

Other info / Complete Logs

* The issue can be observed in Chrome (both and Canary) and Firefox (including Nightly).
* Could the removal of `requestAdapterInfo` in Chrome (https://chromestatus.com/feature/5140787340509184) be a reason?  This wouldn't directly explain the issue in Firefox though.
* requestAdapterInfo is marked as deprecated: https://developer.mozilla.org/en-US/docs/Web/API/GPUAdapter/requestAdapterInfo

See full repro: 
https://github.com/maudnals/mediapipe-request-adapter
kuaashish commented 3 days ago

Hi @maudnals,

Could you please share the complete instructions you are following from our documentation to help us better understand the issue? Additionally, providing the standalone code and complete error logs you are using would be very helpful.

Thank you!!

beaufortfrancois commented 3 days ago

This error is fixed in version 0.10.19-rc.20241118. You can try it by updating your code with the following code

 import {
  FilesetResolver,
  LlmInference,
} from 'https://cdn.jsdelivr.net/npm/@mediapipe/tasks-genai@0.10.19-rc.20241118';
kuaashish commented 3 days ago

Hi @beaufortfrancois,

Thank you for pointing out there, @maudnals, Can you please use nightly one as mentioned above and let us know the status if you are now able to run or still facing the issue?

maudnals commented 3 days ago

@beaufortfrancois @kuaashish I just tried it, I confirm that the error is fixed in 0.10.19-rc.20241118. Thank you!

@kuaashish Would you have an estimate for when 0.10.19 will ship on npm?

kuaashish commented 3 days ago

Hi @maudnals,

We cannot provide an exact timeline at this moment. However, it is expected to be around the end of this year or the beginning of next year.

Thank you!!

maudnals commented 3 days ago

Noted. Thanks!

google-ml-butler[bot] commented 3 days ago

Are you satisfied with the resolution of your issue? Yes No