Stanford BDHG llama.cpp

llama

License: MIT

概述

本项目是 Stanford BDHG 维护的 llama.cpp 的一个分支,专门用于使用 C/C++ 部署 LLaMA 模型。我们的修改将该库打包为 XCFramework,以便作为与多个平台二进制兼容的发布包。包含 Package.swift 文件方便了与 Swift Package Manager (SPM) 的集成。

注意

如果您对本分支所基于的 llama.cpp 代码库有任何疑问,请参阅 上游 llama.cpp 的 README,以获取全面的详细信息和指导。

设置

添加 Stanford BDHG llama.cpp 作为依赖项

您需要将 Stanford BDHG llama.cpp Swift 包添加到 您在 Xcode 中的应用程序Swift 包

重要提示

重要提示:为了使用该库,需要在使用的 Xcode 项目或使用的 SPM 包中设置构建参数,以启用 Xcode 15 和 Swift 5.9 中引入的 Swift / C++ 互操作。请记住,对于嵌套依赖项,需要为整个依赖项树(直到 llama.cpp SPM 包)递归地设置此配置。

对于 Xcode 项目

对于 SPM 包

/// Adds the dependency to the Stanford BDHG llama.cpp SPM package
dependencies: [
    .package(url: "https://github.com/StanfordBDHG/llama.cpp", .upToNextMinor(from: "0.1.0"))
],
targets: [
  .target(
      name: "ExampleConsumingTarget",
      /// State the dependence of the target to llama.cpp
      dependencies: [
          .product(name: "llama", package: "llama.cpp")
      ],
      /// Important: Configure the `.interoperabilityMode(_:)` within the `swiftSettings`
      swiftSettings: [
          .interoperabilityMode(.Cxx)
      ]
  )
]

贡献

欢迎为本项目做出贡献。请务必先阅读 贡献指南贡献者盟约行为准则。您可以在 CONTRIBUTORS.md 文件中找到贡献者列表。

许可证

本项目是现有项目的一个分支,该项目根据 MIT 许可证授权,并且在此分支中所做的所有更改继续遵循 MIT 许可证。有关许可证条款的更多信息,请参见 Licenses 文件夹

我们的研究

有关更多信息,请访问我们的网站 biodesigndigitalhealth.stanford.edu

Stanford Byers Center for Biodesign Logo Stanford Byers Center for Biodesign Logo