From b35d286d9ee36bd33af0bd1f5bb5c718cfb3b4ca Mon Sep 17 00:00:00 2001 From: Meng Zhang Date: Sun, 19 Nov 2023 20:27:30 -0800 Subject: [PATCH] fix: save_model_info failed if dir not exist (#845) --- crates/tabby-common/src/registry.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/crates/tabby-common/src/registry.rs b/crates/tabby-common/src/registry.rs index 642e39d..17a6767 100644 --- a/crates/tabby-common/src/registry.rs +++ b/crates/tabby-common/src/registry.rs @@ -69,6 +69,7 @@ impl ModelRegistry { pub fn save_model_info(&self, name: &str) { let model_info = self.get_model_info(name); let path = self.get_model_dir(name).join("tabby.json"); + fs::create_dir_all(path.parent().unwrap()).unwrap(); serdeconv::to_json_file(model_info, path).unwrap(); }