pub struct ModelsCat { /* private fields */ }
Expand description
A struct representing a models management system for downloading, pulling, and managing files from a hub.
This struct provides functionalities such as:
- Pulling an entire repository with or without progress tracking.
- Downloading specific files with or without progress tracking.
- Listing hub files and local cached files.
- Removing files or clearing the entire cache.
Implementations§
Source§impl ModelsCat
impl ModelsCat
Sourcepub fn new_with_endpoint(repo: Repo, endpoint: String) -> Self
pub fn new_with_endpoint(repo: Repo, endpoint: String) -> Self
Creates a new ModelsCat
instance with a custom endpoint.
Sourcepub fn pull(&self) -> Result<(), OpsError>
pub fn pull(&self) -> Result<(), OpsError>
Pulls the entire repository without progress tracking.
Sourcepub fn pull_with_progress(
&self,
progress: impl Progress,
) -> Result<(), OpsError>
pub fn pull_with_progress( &self, progress: impl Progress, ) -> Result<(), OpsError>
Pulls the entire repository with progress tracking.
Sourcepub fn download(&self, filename: &str) -> Result<(), OpsError>
pub fn download(&self, filename: &str) -> Result<(), OpsError>
Downloads a specific file from the hub without progress tracking.
The filename including extension and parent directory, such as models.gguf
or gguf/models.gguf
.
Sourcepub fn download_with_progress(
&self,
filename: &str,
progress: impl Progress,
) -> Result<(), OpsError>
pub fn download_with_progress( &self, filename: &str, progress: impl Progress, ) -> Result<(), OpsError>
Downloads a specific file from the hub with progress tracking.
The filename including extension and parent directory, such as models.gguf
or gguf/models.gguf
.
Sourcepub fn remove_all(&self) -> Result<(), OpsError>
pub fn remove_all(&self) -> Result<(), OpsError>
Remove all files in the repo
Auto Trait Implementations§
impl Freeze for ModelsCat
impl RefUnwindSafe for ModelsCat
impl Send for ModelsCat
impl Sync for ModelsCat
impl Unpin for ModelsCat
impl UnwindSafe for ModelsCat
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