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

Function find_cached_model_complete_single

cake-core/src/utils/hf.rs:267–285  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

265
266 #[test]
267 fn find_cached_model_complete_single() {
268 let _lock = ENV_LOCK.lock().unwrap();
269 let tmp = tempfile::tempdir().unwrap();
270 let cache = tmp.path();
271 std::env::set_var("HF_HUB_CACHE", cache.to_str().unwrap());
272
273 let snap = cache
274 .join("models--test--model")
275 .join("snapshots")
276 .join("abc123");
277 fs::create_dir_all(&snap).unwrap();
278 fs::write(snap.join("config.json"), "{}").unwrap();
279 fs::write(snap.join("model.safetensors"), "data").unwrap();
280
281 let result = find_cached_model("test/model");
282 assert_eq!(result, Some(snap));
283
284 std::env::remove_var("HF_HUB_CACHE");
285 }
286
287 #[test]
288 fn find_cached_model_complete_sharded() {

Callers

nothing calls this directly

Calls 1

find_cached_modelFunction · 0.85

Tested by

no test coverage detected