Skip to content

Commit

Permalink
test: add assertions for new model path migration in registry tests
Browse files Browse the repository at this point in the history
  • Loading branch information
wsxiaoys committed Jan 14, 2025
1 parent e93e28f commit 3f4802d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions crates/tabby-common/src/registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ mod tests {
let dir = registry.get_model_dir("StarCoder-1B");

let old_model_path = dir.join(LEGACY_GGML_MODEL_PATH.as_str());
let new_model_path = dir.join("ggml").join("model-00001-of-00001.gguf");
tokio::fs::create_dir_all(old_model_path.parent().unwrap())
.await
.unwrap();
Expand All @@ -210,11 +211,13 @@ mod tests {
.await
.unwrap();

assert!(!new_model_path.exists());
registry.migrate_legacy_model_path("StarCoder-1B").unwrap();
assert!(registry
.get_model_entry_path("StarCoder-1B")
.unwrap()
.exists());
assert!(!old_model_path.exists());
assert!(new_model_path.exists());
}
}

0 comments on commit 3f4802d

Please sign in to comment.