swift : update Package.swift to use ggml as package dependency (#1701)

* updates Package.swift to use ggml as dependency

* cleans up the Package.swift file by removing redundant source files

* updates ggml url src to ggerganov
This commit is contained in:
Ashraful Islam 2024-01-03 11:30:26 -06:00 committed by GitHub
parent a3d0aa73d1
commit 993acb5d41
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -13,9 +13,13 @@ let package = Package(
products: [ products: [
.library(name: "whisper", targets: ["whisper"]), .library(name: "whisper", targets: ["whisper"]),
], ],
dependencies: [
.package(url: "https://github.com/ggerganov/ggml.git", .branch("master"))
],
targets: [ targets: [
.target( .target(
name: "whisper", name: "whisper",
dependencies: ["ggml"],
path: ".", path: ".",
exclude: [ exclude: [
"bindings", "bindings",
@ -32,14 +36,8 @@ let package = Package(
"Makefile" "Makefile"
], ],
sources: [ sources: [
"ggml.c",
"whisper.cpp", "whisper.cpp",
"ggml-alloc.c",
"ggml-backend.c",
"ggml-quants.c",
"ggml-metal.m"
], ],
resources: [.process("ggml-metal.metal")],
publicHeadersPath: "spm-headers", publicHeadersPath: "spm-headers",
cSettings: [ cSettings: [
.unsafeFlags(["-Wno-shorten-64-to-32", "-O3", "-DNDEBUG"]), .unsafeFlags(["-Wno-shorten-64-to-32", "-O3", "-DNDEBUG"]),