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

Method from_path

cake-core/src/models/olmo2/config.rs:44–51  ·  view source on GitHub ↗
(path: &Path)

Source from the content-addressed store, hash-verified

42
43impl 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);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected