diff --git a/.swiftpm/configuration/Package.resolved b/.swiftpm/configuration/Package.resolved new file mode 100644 index 0000000..3ea8289 --- /dev/null +++ b/.swiftpm/configuration/Package.resolved @@ -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 +} diff --git a/Sources/LLM/LLM.swift b/Sources/LLM/LLM.swift index d1ca295..41c8b2e 100644 --- a/Sources/LLM/LLM.swift +++ b/Sources/LLM/LLM.swift @@ -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 {