cdiddy77 / react-native-llm-mediapipe

Run an LLM on iOS & Android devices using React Native
MIT License
17 stars 1 forks source link

Cannot read property 'createModel' of null #7

Open kumard3 opened 2 weeks ago

kumard3 commented 2 weeks ago

hi getting this error while using the package , i might be using it wrong, can you help me with

    storageType: 'file',
    modelPath: './gemma-2b-it-gpu-int4.bin',
  });
cdiddy77 commented 1 week ago

That filepath needs to point to a location on your device.

For android, see here

For iOS, you need to find a way to push the file to local application storage, or perhaps an icloud location, if you are familiar with how that works, or potentially using the iOS platform APIs for accessing files.

The easiest way, on both platforms, is simply to bundle the model as an asset.

kumard3 commented 1 week ago

That filepath needs to point to a location on your device.

For android, see here

For iOS, you need to find a way to push the file to local application storage, or perhaps an icloud location, if you are familiar with how that works, or potentially using the iOS platform APIs for accessing files.

The easiest way, on both platforms, is simply to bundle the model as an asset.

Thank you I will try that, okay I have two more questions

  1. What is the type asset ?
  2. The .bin model, is the right one , right ?
cdiddy77 commented 1 week ago

Yes and yes.

On Wed, Jun 26, 2024 at 7:58 AM Kumar Deepanshu @.***> wrote:

That filepath needs to point to a location on your device.

For android, see here https://ai.google.dev/edge/mediapipe/solutions/genai/llm_inference/android#push_model_to_the_device

For iOS, you need to find a way to push the file to local application storage, or perhaps an icloud location, if you are familiar with how that works, or potentially using the iOS platform APIs for accessing files.

The easiest way, on both platforms, is simply to bundle the model as an asset.

Thank you I will try that, okay I have two more questions

  1. What is the type asset ?
  2. The .bin model, is the right one , right ?

— Reply to this email directly, view it on GitHub https://github.com/cdiddy77/react-native-llm-mediapipe/issues/7#issuecomment-2191510203, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABDG2KJY7E57JBCI5VGRNRLZJKUGDAVCNFSM6AAAAABJ4XDTX2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOJRGUYTAMRQGM . You are receiving this because you commented.Message ID: @.***>

kumard3 commented 1 week ago

getting this error createModel [Error: internal: Failed to initialize session: %sCan not open OpenCL library on this device - undefined symbol: clSetPerfHintQCOM]

i have tried it on physical pixel 7 and emulator pixel 8 pro.