pub struct Config {
pub voice: String,
pub speed: f32,
pub model: String,
pub threads: usize,
pub idle_unload_secs: u64,
pub muted: bool,
pub max_chars: usize,
pub cleanup: CleanupConfig,
pub chunking: ChunkConfig,
}Fields§
§voice: String§speed: f32§model: Stringfp32 | fp16 | q8. Measured: fp32 RTF 4.78, fp16 4.66, q8 1.40.
threads: usizeMeasured peak at 8; 16 and 24 both regress.
idle_unload_secs: u64Seconds of an empty queue before the ~1.27 GB ORT session is dropped.
muted: bool§max_chars: usizeSubmissions longer than this are refused.
cleanup: CleanupConfig§chunking: ChunkConfigImplementations§
Source§impl Config
impl Config
pub fn load() -> (Config, Option<String>)
Sourcepub fn load_from(path: &Path) -> (Config, Option<String>)
pub fn load_from(path: &Path) -> (Config, Option<String>)
Returns the config and, if the file existed but could not be parsed, a human-readable reason. A missing file is not an error.
Sourcepub fn save_to(&self, path: &Path) -> Result<()>
pub fn save_to(&self, path: &Path) -> Result<()>
Write atomically: a temp file in the same directory, then rename. The caller is responsible for ignoring the resulting inotify event.
pub fn save(&self) -> Result<()>
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Config
impl<'de> Deserialize<'de> for Config
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for Config
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnsafeUnpin for Config
impl UnwindSafe for Config
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more