llama.cpp 繼續有不錯的發展,可以用來做東西玩了。今天首先做了個 llama.cpp 的 Swift Package: https://github.com/siuying/llama.swift
import Llama
// 1. Open a model
let modelPath = Bundle.module.path(forResource: "gpt4all-lora-quantized", ofType: "bin")!
let llama = try Llama(path: modelPath)
// 2. Predict words based on input
let result = try llama.predict("Neil Armstrong: