Load the configuration from the given path.
(path: &Path)
| 44 | impl LlamaConfig { |
| 45 | /// Load the configuration from the given path. |
| 46 | pub fn from_path(path: &Path) -> Result<Self> { |
| 47 | log::info!("loading configuration from {}", path.display()); |
| 48 | |
| 49 | let data = |
| 50 | std::fs::read(path).map_err(|e| anyhow!("can't read {}: {:?}", path.display(), e))?; |
| 51 | serde_json::from_slice(&data) |
| 52 | .map_err(|e| anyhow!("can't parse {}: {:?}", path.display(), e)) |
| 53 | } |
| 54 | |
| 55 | /// Return the number of kv heads. |
| 56 | pub fn num_key_value_heads(&self) -> usize { |
nothing calls this directly
no outgoing calls
no test coverage detected