iOS LLM Task SDK is NOT initialized successfully via KMP #5601
Labels
platform:ios
MediaPipe IOS issues
stat:awaiting googler
Waiting for Google Engineer's Response
task:LLM inference
Issues related to MediaPipe LLM Inference Gen AI setup
Have I written custom code (as opposed to using a stock example script provided in MediaPipe)
Yes
OS Platform and Distribution
iOS 15
MediaPipe Tasks SDK version
0.10.14
Task name (e.g. Image classification, Gesture recognition etc.)
LLM Inference
Programming Language and version (e.g. C++, Python, Java)
Kotlin, Objective-C, Swift
Describe the actual behavior
It crashed (NPE) right after "Metal LLM tokens initialized" got printed.
Describe the expected behaviour
Should be initialized normally. Can add a new init method with error catching inside and returning nullable error string.
Standalone code/steps you may have used to try to get what you need
MPPLLMInference
that generated by Kotlin Interop from step 1:This may come from the limitation of KMP interop (https://kotlinlang.org/docs/native-objc-interop.html#errors-and-exceptions), since the constructor signature is
@objc public init(options: Options) throws {...}
.mediapipe/mediapipe/tasks/ios/genai/inference/sources/LlmInference.swift
Line 56 in cdc08d0
A full example for this issue can be found from below:
https://github.com/2BAB/MediaPiper/blob/ios-sdk-init-crash/app/src/iosMain/kotlin/me.xx2bab.mediapiper/llm/LLMOperator.ios.kt#L50
Other info / Complete Logs
No response
The text was updated successfully, but these errors were encountered: