fix: save_model_info failed if dir not exist (#845)

feat-display-remote-workers
Meng Zhang 2023-11-19 20:27:30 -08:00 committed by GitHub
parent 1583e76994
commit b35d286d9e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions

View File

@ -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();
}