Add a Package.swift for SwiftPM support
This commit is contained in:
parent
a18c19259a
commit
927bc26e03
4 changed files with 27 additions and 1 deletions
5
.gitignore
vendored
5
.gitignore
vendored
|
@ -5,6 +5,7 @@
|
|||
.vscode/
|
||||
.DS_Store
|
||||
|
||||
.build/
|
||||
build/
|
||||
build-em/
|
||||
build-debug/
|
||||
|
@ -25,3 +26,7 @@ compile_commands.json
|
|||
|
||||
.envrc
|
||||
.direnv/
|
||||
|
||||
.venv
|
||||
__pycache__
|
||||
.swiftpm
|
||||
|
|
20
Package.swift
Normal file
20
Package.swift
Normal file
|
@ -0,0 +1,20 @@
|
|||
// swift-tools-version:5.3
|
||||
|
||||
import PackageDescription
|
||||
|
||||
let package = Package(
|
||||
name: "llama",
|
||||
products: [
|
||||
.library(name: "llama", targets: ["llama"]),
|
||||
],
|
||||
targets: [
|
||||
.target(
|
||||
name: "llama",
|
||||
path: ".",
|
||||
exclude: ["main.cpp", "tests", "quantize.cpp"],
|
||||
publicHeadersPath: "spm-headers",
|
||||
cSettings: [.unsafeFlags(["-Wno-shorten-64-to-32"])]
|
||||
),
|
||||
],
|
||||
cxxLanguageStandard: .cxx11
|
||||
)
|
2
llama.h
2
llama.h
|
@ -117,7 +117,7 @@ extern "C" {
|
|||
|
||||
// TODO: improve the last_n_tokens interface ?
|
||||
LLAMA_API llama_token llama_sample_top_p_top_k(
|
||||
llama_context * ctx,
|
||||
struct llama_context * ctx,
|
||||
const llama_token * last_n_tokens_data,
|
||||
int last_n_tokens_size,
|
||||
int top_k,
|
||||
|
|
1
spm-headers/llama.h
Symbolic link
1
spm-headers/llama.h
Symbolic link
|
@ -0,0 +1 @@
|
|||
../llama.h
|
Loading…
Add table
Add a link
Reference in a new issue