Skip to content

Add Swift Package Manager manifest #939

New issue

Have a question about this project? Sign up for a free account to open an issue and contact its maintainers and the community.

By clicking “Sign up for ”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on ? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

afarnham
Copy link

@afarnham afarnham commented May 20, 2023

This PR adds a manifest so this repo can be targeted from Swift projects and Xcode using Swift Package Manager.

In order to expose only whisper.h outside the package I've added a new directory, swiftpm with a shim header. If the publicHeadersPath were specified as the root of the repo then all headers in all directories become public as Swift Package manager recurses its public headers directory without any option to turn that off, nor is there an option to specify specific headers.

I've also updated .gitignore prevent check in of any artifacts Swift Package Manager introduces when building and editing.

aaron-foreflight and others added 2 commits May 19, 2023 23:13
Add Swift Package manifest
Remove automatically generated Xcode info
@chidiwilliams
Copy link
Contributor

@afarnham, there's a Swift package at https://.com/ggerganov/whisper.spm

@sindresorhus
Copy link
Contributor

I think it would be better to add the manifest here as it will automatically be kept up to date with Whisper.cpp and it would be easier to use a specific Whisper.cpp commit in a Swift project.

"whisper.cpp",
"ggml.c"
],
publicHeadersPath: "swiftpm"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sindresorhus
Copy link
Contributor

@ggerganov I would be happy to make an updated pull request for this and commit to maintain this file if it's merged. This would make it easier for you too as you don't have to maintain another repository.

Co-authored-by: Sindre Sorhus <[email protected]>
@sindresorhus
Copy link
Contributor

I just noticed that llama.cpp has a Package.swift in the main repo, which is another argument for doing it here too: https://.com/ggerganov/llama.cpp/blob/master/Package.swift

The easist would be to copy-paste that one and simply change a few names.

@ggerganov
Copy link
Member

@sindresorhus

I think this would be great! Definitely need a helping hand and I agree the current solution is not the best.

Btw, I'm planning a new release with parallel decoding support for efficient beam-search. Hoping to do it in the following week, though some more delay can be expected.

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

Successfully merging this pull request may close these issues.

5 participants