1pub mod builder;
2pub mod cache;
3pub mod config;
4pub mod conversion;
5pub mod download;
6pub mod model;
7pub mod pipeline;
8pub mod qwen;
9#[cfg(test)]
10pub mod qwen_shapes_test;
11pub mod state;
12pub mod unified_model_loader;
13pub mod utils;
14
15pub mod cache_manager {
17 pub use crate::cache::*;
18}
19pub mod clean_git_lfs_downloader {
20 pub use crate::download::git_lfs::*;
21}
22pub mod config_generator {
23 pub use crate::config::generator::*;
24}
25pub mod model_config {
26 pub use crate::config::model::*;
27}
28pub mod model_downloader {
29 pub use crate::download::unified::*;
30}
31
32pub use builder::CoreMLModelBuilder;
33pub use cache::CacheManager;
34pub use config::{
35 ComponentConfig, Config, ConfigGenerator, ModelConfig, NamingConfig, ShapeConfig, TensorConfig,
36};
37pub use model::CoreMLModel;
38pub use qwen::{ModelNamingConfig, QwenConfig, QwenModel};
39pub use state::CoreMLState;
40pub use unified_model_loader::{CachedModelInfo, UnifiedModelLoader};
41
42pub use download::{
44 download_model, download_model_to, ensure_model_downloaded, get_cached_model_path,
45};
46
47pub use download::{download_hf_model_clean, verify_download_completeness, CleanDownloadConfig};
49
50pub use utils::{mask, multi_component, sampling};
52
53use std::path::PathBuf;
54
55pub fn get_local_or_remote_file(
58 filename: &str,
59 api: &hf_hub::api::sync::ApiRepo,
60) -> anyhow::Result<PathBuf> {
61 let local_filename = PathBuf::from(filename);
62 if local_filename.exists() {
63 Ok(local_filename)
64 } else {
65 Ok(api.get(filename)?)
66 }
67}