Skip to content
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

Issue: LibWhisper.swift Fails to Build Objective-C Module whisper #2757

Open
DeepBhupatkar opened this issue Jan 23, 2025 · 7 comments
Open

Comments

@DeepBhupatkar
Copy link

DeepBhupatkar commented Jan 23, 2025

I'm encountering a build issue with the iOS Swift example for whisper.cpp. The project throws the following error:
Steps I followed:

  1. Cloned the whisper.cpp repository.
  2. Tried running the iOS Swift example located in examples/whisper.swiftui.

However, the build fails with the following errors:
Key Errors:
'whisper.h' file not found with
Multiple Cannot find in scope errors, such as:
Cannot find 'whisper_free' in scope
Cannot find 'whisper_full_default_params' in scope
Cannot find 'WHISPER_SAMPLING_GREEDY' in scope

Am I missing any steps? I followed all five steps from the SwiftUI project guide : https://github.com/ggerganov/whisper.cpp/tree/master/examples/whisper.swiftui, but despite trying multiple times, this issue keeps occurring. same thing happing in object-c example.

@AlanConstantino
Copy link

I had this issue happen to me too! It also happens on the swift ui app example as well.

The whisper.h file one seems to be an easy fix by just changing

import <whisper.h>

to

import "whisper.h"

Now I don't know if this is the actual "fix" for this but it the compiler seems to stop yelling at me after this change.

However when you go to compile it, it still causes issues. I think there is something wrong with the way Xcode links to the whisper package which is causing issue you're seeing

Image

@DeepBhupatkar
Copy link
Author

I made that change, but the issue persists, just like in the image you attached. However, with the help of someones other works and some custom build modifications, I was able to create a package that allows me to run whisper.cpp. I’m now planning to build a new SPM or pod for public release or use.

@pgorzelany
Copy link

Can you share the solution?

@zydeico
Copy link

zydeico commented Jan 31, 2025

Same issue here

@DeepBhupatkar
Copy link
Author

Yes, sure! Here you go. This is the link to my repo for the Whisper.cpp project: https://github.com/DeepBhupatkar/swift-whisper.cpp-transcription (ignore the README). I'm still working on releasing the package through SPM and CocoaPods, but for now, you can use it from my example just copy the package and use it.

@AlanConstantino
Copy link

Yes, sure! Here you go. This is the link to my repo for the Whisper.cpp project: https://github.com/DeepBhupatkar/swift-whisper.cpp-transcription (ignore the README). I'm still working on releasing the package through SPM and CocoaPods, but for now, you can use it from my example just copy the package and use it.

Appreciate you broski!

@anka
Copy link

anka commented Feb 5, 2025

Yes, sure! Here you go. This is the link to my repo for the Whisper.cpp project: https://github.com/DeepBhupatkar/swift-whisper.cpp-transcription (ignore the README). I'm still working on releasing the package through SPM and CocoaPods, but for now, you can use it from my example just copy the package and use it.

@DeepBhupatkar Do you already have some experience with how well the transcription works with your example code? Did you add further optimizations regarding the whisper model parameters for running it on iOS?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants