feat: introduce package traits of Swift 6.1 (#172)

* feat: introduce package traits of Swift 6.1

* fix: CI

* fix: android toolchain install script

* fix: ci for windows

* chore: add debug dump of sdk list

* fix: update devcontainer swift image

* fix?

* chore: remove LLAMA_MOCK=1 since it is no longer required

* chore: add debug print of configuration

* fix: typo

* chore: use signed xcframework of azooKey/llama.cpp

* chore: use updated xcframework

* chore: use updated xcframework

* chore: use updated xcframework

* chore: use updated xcframework

* chore: use updated xcframework

* docs: add usage of Zenzai trait
This commit is contained in:
Miwa
2025-04-06 17:49:14 +09:00
committed by GitHub
parent 3a4e914624
commit 2cde22d3e2
8 changed files with 75 additions and 84 deletions

View File

@@ -1,5 +1,5 @@
import Foundation
#if canImport(SwiftyMarisa)
#if canImport(SwiftyMarisa) && Zenzai
import SwiftyMarisa
/// Base64 Key-Value

View File

@@ -1,5 +1,5 @@
import Foundation
#if canImport(SwiftyMarisa)
#if canImport(SwiftyMarisa) && Zenzai
import SwiftyMarisa
final class SwiftTrainer {

View File

@@ -1,8 +1,8 @@
#if canImport(llama)
#if Zenzai
// Zenzaillama-mock.swift
import llama
#else
import llama_mock
#endif
import SwiftUtils
import HeapModule
import Algorithms

View File

@@ -1,3 +1,5 @@
#if !Zenzai
// ZenzaiMock
private func unimplemented<T>() -> T {
fatalError("unimplemented")
}
@@ -59,4 +61,5 @@ package func llama_vocab_bos(_ vocab: llama_vocab) -> llama_token { unimplemente
package func llama_token_to_piece(_ vocab: llama_vocab, _ token: llama_token, _ buf: UnsafeMutablePointer<Int8>, _ length: Int32, _ lstrip: Int32, _ special: Bool) -> Int32 { unimplemented() }
package func llama_decode(_ ctx: llama_context, _ batch: llama_batch) -> Int { unimplemented() }
package func llama_get_logits(_ ctx: llama_context) -> UnsafeMutablePointer<Float>? { unimplemented() }
package func llama_get_logits(_ ctx: llama_context) -> UnsafeMutablePointer<Float>? { unimplemented() }
#endif