]> git.djapps.eu Git - pkg/ggml/sources/whisper.cpp/commitdiff
swift : package no longer use ggml dependency (#1861)
authorGeorgi Gerganov <redacted>
Mon, 12 Feb 2024 17:54:11 +0000 (19:54 +0200)
committerGitHub <redacted>
Mon, 12 Feb 2024 17:54:11 +0000 (19:54 +0200)
* Revert "swift : update Package.swift to use ggml as package dependency (#1701)"

This reverts commit 993acb5d410cd8eaebaa3fc54d4b153e04bbefce.

* spm : add ggml.h

Package.swift
spm-headers/ggml.h [new symlink]

index e8b85afce81294e54d87607fccea622f720acd6e..bbb7fb03b9972d543ad254992f4213512c096471 100644 (file)
@@ -13,13 +13,9 @@ let package = Package(
     products: [
         .library(name: "whisper", targets: ["whisper"]),
     ],
-    dependencies: [
-        .package(url: "https://github.com/ggerganov/ggml.git", .branch("release"))
-    ],
     targets: [
         .target(
             name: "whisper",
-            dependencies: ["ggml"],
             path: ".",
             exclude: [
                "bindings",
@@ -36,8 +32,14 @@ let package = Package(
                "Makefile"
             ],
             sources: [
+                "ggml.c",
                 "whisper.cpp",
+                "ggml-alloc.c",
+                "ggml-backend.c",
+                "ggml-quants.c",
+                "ggml-metal.m"
             ],
+            resources: [.process("ggml-metal.metal")],
             publicHeadersPath: "spm-headers",
             cSettings: [
                 .unsafeFlags(["-Wno-shorten-64-to-32", "-O3", "-DNDEBUG"]),
diff --git a/spm-headers/ggml.h b/spm-headers/ggml.h
new file mode 120000 (symlink)
index 0000000..3921529
--- /dev/null
@@ -0,0 +1 @@
+../ggml.h
\ No newline at end of file