-
Notifications
You must be signed in to change notification settings - Fork 505
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
Unable to run it in MacOS with Swift APi examples #1368
Comments
The following is an example: git clone https://github.com/k2-fsa/sherpa-onnx
cd sherpa-onnx
./build-swift-macos.sh
cd swift-api-examples
# there are several ./run-xxx.sh
# For instance,
./run-decode-file.sh
./run-tts.sh |
@csukuangfj yeah i already run it, but how to use it with xcode project any example or hints please? |
We have provided the required header file, libraries, and swift APIs. Could you tell us the difficulty you have? Would be great if you can post error logs. |
Hey @csukuangfj I believe that what @Intiserahmed means is that there is example of how to use shepra-onnx in ios application, but there is no example of how to use it in MacOs(desktop) if it is even possible. I am getting following error during build when I added framework from ios example to my MacOS desktop application
|
By the way, there is nothing special with sherpa-onnx. For macOS app development, we provide shared libraries with C API header files. We do provide Swift API examples. Please see #1368 (comment) |
Yeah, I see, but it is still not clear what I need to add and do with my xcode project in order to use shepra-onnx. In other words - in one of the examples you have code like this: var config = sherpaOnnxOfflineSpeakerDiarizationConfig(
segmentation: sherpaOnnxOfflineSpeakerSegmentationModelConfig(
pyannote: sherpaOnnxOfflineSpeakerSegmentationPyannoteModelConfig(model: segmentationModel)),
embedding: sherpaOnnxSpeakerEmbeddingExtractorConfig(model: embeddingExtractorModel),
clustering: sherpaOnnxFastClusteringConfig(numClusters: numSpeakers)
)
let sd = SherpaOnnxOfflineSpeakerDiarizationWrapper(config: &config) What I need to add to xcode project in order to be able to use (I am pretty new in ios/macos development and never used external non swift libraries/packages in my project, so maybe I am missing something trivial) |
In that case, I suggest that you first spend some time learning how to do that. We have provided everything you need to be used in your macos project. You have to learn how to add which file to which place. You may find |
Here is the xcframework for sherpa-onnx that supports both macos x86_64 and macos arm64. To use it in your macos xcode project, please do the following:
You can find it from https://github.com/csukuangfj/onnxruntime-libs/releases/download/v1.17.1/onnxruntime-osx-universal2-static_lib-1.17.1.zip
Please see how little code you need to write to set it up. |
@csukuangfj Thanks a lot for the specific instructions. |
@csukuangfj It worked like a charm first try. Really appreciate it. Thank you very much. |
Hi, iOS is properly working, but when i try with MacOS build script with swift api examples, kindda confuse how to use it ? Any step by step guide for macos?
The text was updated successfully, but these errors were encountered: