(path: &Path)
| 42 | |
| 43 | impl OLMo2Config { |
| 44 | pub fn from_path(path: &Path) -> Result<Self> { |
| 45 | log::info!("loading OLMo 2 configuration from {}", path.display()); |
| 46 | |
| 47 | let data = |
| 48 | std::fs::read(path).map_err(|e| anyhow!("can't read {}: {:?}", path.display(), e))?; |
| 49 | serde_json::from_slice(&data) |
| 50 | .map_err(|e| anyhow!("can't parse {}: {:?}", path.display(), e)) |
| 51 | } |
| 52 | |
| 53 | pub fn into_config(self) -> Config { |
| 54 | let num_kv_heads = self.num_key_value_heads.unwrap_or(self.num_attention_heads); |
nothing calls this directly
no outgoing calls
no test coverage detected