pub struct Cache { /* private fields */ }
Expand description
A local struct used to fetch information from the cache folder.
Implementations§
source§impl Cache
impl Cache
sourcepub fn token_path(&self) -> PathBuf
pub fn token_path(&self) -> PathBuf
Returns the location of the token file
sourcepub fn token(&self) -> Option<String>
pub fn token(&self) -> Option<String>
Returns the token value if it exists in the cache
Use huggingface-cli login
to set it up.
sourcepub fn model(&self, model_id: String) -> CacheRepo
pub fn model(&self, model_id: String) -> CacheRepo
Simple wrapper over
let cache = Cache::new("/tmp/".into());
let cache = cache.repo(Repo::new(model_id, RepoType::Model));
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for Cache
impl Send for Cache
impl Sync for Cache
impl Unpin for Cache
impl UnwindSafe for Cache
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