- add replacement tokenizer class for unknown tokenizers - fix quantization for models that don't have lm_head quantized Requires https://github.com/ml-explore/mlx-swift/pull/28
16 lines
311 B
Swift
16 lines
311 B
Swift
// Copyright © 2024 Apple Inc.
|
|
|
|
import Foundation
|
|
import MLX
|
|
import MLXNN
|
|
|
|
// Interface for all LLM Models
|
|
public protocol LLMModel: Module {
|
|
|
|
var vocabularySize: Int { get }
|
|
|
|
func callAsFunction(_ inputs: MLXArray, cache: [(MLXArray, MLXArray)]?) -> (
|
|
MLXArray, [(MLXArray, MLXArray)]
|
|
)
|
|
}
|