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 authored Jan 14, 2025
1 parent 49c8655 commit 5aa27b5
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());
}
}

1 comment on commit 5aa27b5

@micks300
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hi is there any person there to talk to?

Please sign in to comment.