pub struct TranslationConfig {
pub enabled: bool,
pub model_id: Option<String>,
pub model_bundle: Option<PathBuf>,
pub model_dir: Option<PathBuf>,
pub model_cache_only: bool,
pub source_language: Option<String>,
pub target_language: Option<String>,
pub max_new_tokens: usize,
}Expand description
Library-owned controls for post-ASR translation model resolution.
These controls intentionally do not depend on CLI argument types. Embedding applications can select an explicit bundle, an application model directory, or cache-only resolution without constructing a command-line configuration.
Fields§
§enabled: boolEnables post-ASR translation for finite Workflow Composition.
model_id: Option<String>Hugging Face model ID used by the legacy single-model translation path.
model_bundle: Option<PathBuf>Explicit local Marian model bundle, preferred over cache resolution.
model_dir: Option<PathBuf>Application-selected model/cache root used for translation resolution.
model_cache_only: boolForbids translation model downloads and fails when local assets are absent.
source_language: Option<String>ISO 639-1 source language code for the configured model.
target_language: Option<String>ISO 639-1 target language code for the configured model.
max_new_tokens: usizeMaximum number of tokens produced for each translated segment.
Trait Implementations§
Source§impl Clone for TranslationConfig
impl Clone for TranslationConfig
Source§fn clone(&self) -> TranslationConfig
fn clone(&self) -> TranslationConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for TranslationConfig
impl Debug for TranslationConfig
Source§impl Default for TranslationConfig
impl Default for TranslationConfig
Source§impl<'de> Deserialize<'de> for TranslationConfig
impl<'de> Deserialize<'de> for TranslationConfig
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>,
impl Eq for TranslationConfig
Source§impl PartialEq for TranslationConfig
impl PartialEq for TranslationConfig
Source§impl Serialize for TranslationConfig
impl Serialize for TranslationConfig
impl StructuralPartialEq for TranslationConfig
Auto Trait Implementations§
impl Freeze for TranslationConfig
impl RefUnwindSafe for TranslationConfig
impl Send for TranslationConfig
impl Sync for TranslationConfig
impl Unpin for TranslationConfig
impl UnsafeUnpin for TranslationConfig
impl UnwindSafe for TranslationConfig
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more