microsoft / onnxruntime

ONNX Runtime: cross-platform, high performance ML inferencing and training accelerator
https://onnxruntime.ai
MIT License
13.37k stars 2.74k forks source link

[Mobile] onnxruntime-objc crash #21026

Open hasayakey opened 1 week ago

hasayakey commented 1 week ago

Describe the issue

I am currently using Whisper for ASR, which is a tiny/base multi-language model generated by Olive. It works fine most of the time, but when I feed Chinese audio to Whisper, the generated string may crash in some cases.

企业微信20240613-104431

企业微信20240613-105631

To reproduce

https://github.com/microsoft/Olive/blob/main/examples/whisper/README.md python prepare_whisper_configs.py --model_name openai/whisper-tiny --no_audio_decoder --multilingual --enable_timestamps olive run --config whisper_cpu_int8.json --setup

Urgency

No response

Platform

iOS

OS Version

17.5.1

ONNX Runtime Installation

Built from Source

Compiler Version (if 'Built from Source')

1.18.0

Package Name (if 'Released Package')

None

ONNX Runtime Version or Commit ID

1.18.0

ONNX Runtime API

Objective-C/Swift

Architecture

ARM64

Execution Provider

Default CPU

Execution Provider Library Version

No response

skottmckay commented 1 week ago

It's not clear from the screenshots what the complete error message is, or what the callstack is.

Which object Is the nil?

hasayakey commented 1 week ago

It's not clear from the screenshots what the complete error message is, or what the callstack is.

Which object Is the nil?

create NSString from tensorStrindData return nil

edgchen1 commented 1 week ago

is the string a valid UTF-8 encoded string? the representation shown by lldb (po tensorStringData.data()) in the screenshot has some odd-looking content at the end.

hasayakey commented 1 week ago

is the string a valid UTF-8 encoded string? the representation shown by lldb (po tensorStringData.data()) in the screenshot has some odd-looking content at the end.

This is not a valid UTF-8 string, which will cause NSString creation to fail, and NSMutableArray cannot add nil objects.