add support for OpenELM (#63)

* add support for OpenELM
* register model configuration for bootstrap
This commit is contained in:
Sachin Desai
2024-04-30 09:14:27 -07:00
committed by GitHub
parent dfd79d0542
commit 4d20785b5d
4 changed files with 332 additions and 0 deletions

View File

@@ -35,6 +35,7 @@ public enum ModelType: String, Codable {
case qwen2
case starcoder2
case cohere
case openelm
public func createModel(configuration: URL) throws -> LLMModel {
switch self {
@@ -66,6 +67,10 @@ public enum ModelType: String, Codable {
let configuration = try JSONDecoder().decode(
CohereConfiguration.self, from: Data(contentsOf: configuration))
return CohereModel(configuration)
case .openelm:
let configuration = try JSONDecoder().decode(
OpenElmConfiguration.self, from: Data(contentsOf: configuration))
return OpenELMModel(configuration)
}
}
}