(path: &Path)
| 52 | |
| 53 | impl Phi4Config { |
| 54 | pub fn from_path(path: &Path) -> Result<Self> { |
| 55 | log::info!("loading Phi-4 configuration from {}", path.display()); |
| 56 | |
| 57 | let data = |
| 58 | std::fs::read(path).map_err(|e| anyhow!("can't read {}: {:?}", path.display(), e))?; |
| 59 | serde_json::from_slice(&data) |
| 60 | .map_err(|e| anyhow!("can't parse {}: {:?}", path.display(), e)) |
| 61 | } |
| 62 | |
| 63 | pub fn into_config(self) -> Config { |
| 64 | 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