feat: add command r model support (#35)

* feat: add command r model support
This commit is contained in:
Anchen
2024-03-27 06:43:10 +11:00
committed by GitHub
parent c37018d7d2
commit 63531bc5fa
5 changed files with 254 additions and 2 deletions

View File

@@ -33,6 +33,7 @@ public enum ModelType: String, Codable {
case gemma
case qwen2
case starcoder2
case cohere
func createModel(configuration: URL) throws -> LLMModel {
switch self {
@@ -56,6 +57,10 @@ public enum ModelType: String, Codable {
let configuration = try JSONDecoder().decode(
Starcoder2Configuration.self, from: Data(contentsOf: configuration))
return Starcoder2Model(configuration)
case .cohere:
let configuration = try JSONDecoder().decode(
CohereConfiguration.self, from: Data(contentsOf: configuration))
return CohereModel(configuration)
}
}
}