Files
mlx-swift-examples/Libraries/LLM/LLMModel.swift
David Koski bb7bacc077 fix for #2 -- CodeLlama crashes
- 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
2024-02-26 10:38:05 -08:00

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)]
)
}