pub struct ConfigGenerator { /* private fields */ }Expand description
Modular configuration generator for auto-detecting model parameters
Implementations§
Source§impl ConfigGenerator
impl ConfigGenerator
Sourcepub fn generate_config_from_directory_enhanced(
&self,
model_dir: &Path,
model_id: &str,
model_type: &str,
) -> Result<ModelConfig>
pub fn generate_config_from_directory_enhanced( &self, model_dir: &Path, model_id: &str, model_type: &str, ) -> Result<ModelConfig>
Generate a config from a downloaded model directory using enhanced metadata-driven detection
This function inspects .mlpackage files in a directory and generates a complete ModelConfig with proper shapes and component configurations, using metadata-driven component role detection to support both unified and split FFN architectures.
Sourcepub fn generate_config_from_directory(
&self,
model_dir: &Path,
model_id: &str,
model_type: &str,
) -> Result<ModelConfig>
pub fn generate_config_from_directory( &self, model_dir: &Path, model_id: &str, model_type: &str, ) -> Result<ModelConfig>
Generate a config from a downloaded model directory (legacy method)
This function inspects .mlpackage files in a directory and generates a complete ModelConfig with proper shapes and component configurations.
Sourcepub fn load_cached_config(&self, model_id: &str) -> Result<Option<ModelConfig>>
pub fn load_cached_config(&self, model_id: &str) -> Result<Option<ModelConfig>>
Load a cached configuration if available
Sourcepub fn has_cached_config(&self, model_id: &str) -> bool
pub fn has_cached_config(&self, model_id: &str) -> bool
Check if a cached configuration exists
Sourcepub fn clear_cached_config(&self, model_id: &str) -> Result<()>
pub fn clear_cached_config(&self, model_id: &str) -> Result<()>
Clear cached configuration for a model
Source§impl ConfigGenerator
impl ConfigGenerator
Sourcepub fn find_mlpackage_files(&self, model_dir: &Path) -> Result<Vec<PathBuf>>
pub fn find_mlpackage_files(&self, model_dir: &Path) -> Result<Vec<PathBuf>>
Find all .mlpackage files in a directory (legacy interface)
Sourcepub fn infer_component_name_from_file(&self, package_path: &Path) -> String
pub fn infer_component_name_from_file(&self, package_path: &Path) -> String
Infer component name from package filename (legacy interface)
Sourcepub fn analyze_mlpackage(&self, package_path: &Path) -> Result<ComponentConfig>
pub fn analyze_mlpackage(&self, package_path: &Path) -> Result<ComponentConfig>
Analyze a single .mlpackage file (legacy interface)
Sourcepub fn extract_function_based_components(
&self,
package_path: &Path,
_base_config: &ComponentConfig,
) -> Result<Option<HashMap<String, ComponentConfig>>>
pub fn extract_function_based_components( &self, package_path: &Path, _base_config: &ComponentConfig, ) -> Result<Option<HashMap<String, ComponentConfig>>>
Extract function-based components (legacy interface)
Sourcepub fn parse_tensor_configs_from_schema(
&self,
schema: &[Value],
) -> Result<HashMap<String, TensorConfig>>
pub fn parse_tensor_configs_from_schema( &self, schema: &[Value], ) -> Result<HashMap<String, TensorConfig>>
Parse tensor configurations from schema (legacy interface)
Sourcepub fn compute_shape_info_generic(
&self,
components: &HashMap<String, ComponentConfig>,
) -> Result<ShapeConfig>
pub fn compute_shape_info_generic( &self, components: &HashMap<String, ComponentConfig>, ) -> Result<ShapeConfig>
Compute shape info (legacy interface) Returns an error if components have insufficient tensor metadata
Sourcepub fn generate_naming_config_generic(
&self,
packages: &[PathBuf],
) -> NamingConfig
pub fn generate_naming_config_generic( &self, packages: &[PathBuf], ) -> NamingConfig
Generate naming config (legacy interface)
Sourcepub fn determine_execution_mode_generic(
&self,
components: &HashMap<String, ComponentConfig>,
) -> String
pub fn determine_execution_mode_generic( &self, components: &HashMap<String, ComponentConfig>, ) -> String
Determine execution mode (legacy interface)
Sourcepub fn cache_generated_config(
&self,
model_id: &str,
config: &ModelConfig,
) -> Result<()>
pub fn cache_generated_config( &self, model_id: &str, config: &ModelConfig, ) -> Result<()>
Cache generated config (legacy interface)
Auto Trait Implementations§
impl Freeze for ConfigGenerator
impl RefUnwindSafe for ConfigGenerator
impl Send for ConfigGenerator
impl Sync for ConfigGenerator
impl Unpin for ConfigGenerator
impl UnwindSafe for ConfigGenerator
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
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