1pub mod builder;
2pub mod clean_git_lfs_downloader;
3pub mod config;
4pub mod conversion;
5pub mod model;
6pub mod model_downloader;
7pub mod qwen;
8pub mod state;
9pub mod utils;
10
11pub use builder::CoreMLModelBuilder;
12pub use config::Config;
13pub use model::CoreMLModel;
14pub use qwen::{QwenConfig, QwenModel};
15pub use state::CoreMLState;
16
17pub use model_downloader::{
19 download_model, download_model_to, ensure_model_downloaded, get_cached_model_path,
20};
21
22pub use clean_git_lfs_downloader::{
24 download_hf_model_clean, verify_download_completeness, CleanDownloadConfig,
25};
26
27pub use utils::{mask, multi_component, sampling};
29
30use std::path::PathBuf;
31
32pub fn get_local_or_remote_file(
35 filename: &str,
36 api: &hf_hub::api::sync::ApiRepo,
37) -> anyhow::Result<PathBuf> {
38 let local_filename = PathBuf::from(filename);
39 if local_filename.exists() {
40 Ok(local_filename)
41 } else {
42 Ok(api.get(filename)?)
43 }
44}