Add Package.swift (#39)

* Add Package.swift for LLM and MNIST
* Make ModelType properties public
* Make ModelType method createModel public
* Add installation instructions to readme
This commit is contained in:
Ronald Mannak
2024-04-01 11:04:02 -07:00
committed by GitHub
parent e48e2ce2c9
commit b3eb428c60
6 changed files with 163 additions and 7 deletions

View File

@@ -35,7 +35,7 @@ public enum ModelType: String, Codable {
case starcoder2
case cohere
func createModel(configuration: URL) throws -> LLMModel {
public func createModel(configuration: URL) throws -> LLMModel {
switch self {
case .mistral, .llama:
let configuration = try JSONDecoder().decode(
@@ -66,7 +66,7 @@ public enum ModelType: String, Codable {
}
public struct BaseConfiguration: Codable {
let modelType: ModelType
public let modelType: ModelType
public struct Quantization: Codable {
public init(groupSize: Int, bits: Int) {
@@ -83,7 +83,7 @@ public struct BaseConfiguration: Codable {
}
}
var quantization: Quantization?
public var quantization: Quantization?
enum CodingKeys: String, CodingKey {
case modelType = "model_type"