Skip to content

Commit

Permalink
migrated to latest llama.cpp, now using updated API llama_add_bos_tok…
Browse files Browse the repository at this point in the history
…en as bool instead of int
  • Loading branch information
codi committed Aug 17, 2024
1 parent 0441acc commit 17f75cc
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 2 deletions.
32 changes: 32 additions & 0 deletions .swiftpm/configuration/Package.resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"pins" : [
{
"identity" : "llama.cpp",
"kind" : "remoteSourceControl",
"location" : "https://github.com/ggerganov/llama.cpp/",
"state" : {
"branch" : "master",
"revision" : "2fb9267887d24a431892ce4dccc75c7095b0d54d"
}
},
{
"identity" : "swift-power-assert",
"kind" : "remoteSourceControl",
"location" : "https://github.com/kishikawakatsumi/swift-power-assert",
"state" : {
"revision" : "2fa10dcbbff807fad73b4e2469b43300a50e9bbc",
"version" : "0.12.0"
}
},
{
"identity" : "swift-syntax",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-syntax.git",
"state" : {
"revision" : "64889f0c732f210a935a0ad7cda38f77f876262d",
"version" : "509.1.1"
}
}
],
"version" : 2
}
4 changes: 2 additions & 2 deletions Sources/LLM/LLM.swift
Original file line number Diff line number Diff line change
Expand Up @@ -379,10 +379,10 @@ extension Model {

public func shouldAddBOS() -> Bool {
let addBOS = llama_add_bos_token(self);
guard addBOS != -1 else {
guard !addBOS else {
return llama_vocab_type(self) == LLAMA_VOCAB_TYPE_SPM
}
return addBOS != 0
return addBOS
}

public func decodeOnly(_ token: Token) -> String {
Expand Down

0 comments on commit 17f75cc

Please sign in to comment.