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

Function index_serialization_roundtrip

cake-core/src/utils/split.rs:359–369  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

357
358 #[test]
359 fn index_serialization_roundtrip() {
360 let mut index = Index::new();
361 index.weight_map.insert(
362 "tensor.weight".to_string(),
363 "file.safetensors".to_string(),
364 );
365 let json = serde_json::to_string(&index).unwrap();
366 let deserialized: Index = serde_json::from_str(&json).unwrap();
367 assert_eq!(deserialized.weight_map.len(), 1);
368 assert_eq!(deserialized.weight_map["tensor.weight"], "file.safetensors");
369 }
370}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected