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

Method from_path

cake-core/src/models/llama3/config.rs:46–53  ·  view source on GitHub ↗

Load the configuration from the given path.

(path: &Path)

Source from the content-addressed store, hash-verified

44impl 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 {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected