MCPcopy Create free account
hub / github.com/evilsocket/cake / from_path

Method from_path

cake-core/src/models/phi4/config.rs:54–61  ·  view source on GitHub ↗
(path: &Path)

Source from the content-addressed store, hash-verified

52
53impl 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);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected