diff options
| author | sigoden <sigoden@gmail.com> | 2025-01-27 19:35:26 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-01-27 19:35:26 +0800 |
| commit | 22d21237dd3a8ca8144569e43aacc5aeda0cf53f (patch) | |
| tree | fa816e2ecbe61c15e8b23fce42e120b617a381a5 /src | |
| parent | 20cada3d0ecfb3a63bd24138fa1ad329c778c8d1 (diff) | |
| download | aichat-22d21237dd3a8ca8144569e43aacc5aeda0cf53f.tar.gz | |
refactor: save model-override file as yaml (#1131)
Diffstat (limited to 'src')
| -rw-r--r-- | src/config/mod.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/config/mod.rs b/src/config/mod.rs index 20abbae..c9efd72 100644 --- a/src/config/mod.rs +++ b/src/config/mod.rs @@ -426,7 +426,7 @@ impl Config { } pub fn models_override_file() -> PathBuf { - Self::local_path("models-override.json") + Self::local_path("models-override.yaml") } pub fn state(&self) -> StateFlags { @@ -1871,7 +1871,7 @@ impl Config { list, }; let models_override_data = - serde_json::to_string_pretty(&models_override).with_context(|| "Failed to serde {}")?; + serde_yaml::to_string(&models_override).with_context(|| "Failed to serde {}")?; let model_override_path = Self::models_override_file(); ensure_parent_exists(&model_override_path)?; @@ -1890,7 +1890,7 @@ impl Config { ) }; let content = read_to_string(&model_override_path).with_context(err)?; - let models_override: ModelsOverride = serde_json::from_str(&content).with_context(err)?; + let models_override: ModelsOverride = serde_yaml::from_str(&content).with_context(err)?; if models_override.version != env!("CARGO_PKG_VERSION") { bail!("Incompatible version") } |
