pub struct HuggingFaceLoader {
pub hf_token: Option<String>,
pub hf_token_env_var: String,
pub hf_api: OnceCell<Api>,
}Fields§
§hf_token: Option<String>§hf_token_env_var: String§hf_api: OnceCell<Api>Implementations§
Source§impl HuggingFaceLoader
impl HuggingFaceLoader
pub fn new() -> Self
pub fn hf_api(&self) -> &Api
pub fn load_file<T: AsRef<str>, S: Into<String>>( &self, file_name: T, repo_id: S, ) -> Result<PathBuf>
pub fn load_model_safe_tensors<S: Into<String>>( &self, repo_id: S, ) -> Result<Vec<PathBuf>>
pub fn canonicalize_local_path(local_path: PathBuf) -> Result<PathBuf>
pub fn parse_full_model_url(model_url: &str) -> (String, String, String)
pub fn model_url_from_repo_and_local_filename( repo_id: &str, local_model_filename: &str, ) -> String
pub fn model_url_from_repo(repo_id: &str) -> String
pub fn model_id_from_url(model_url: &str) -> String
Trait Implementations§
Source§impl Clone for HuggingFaceLoader
impl Clone for HuggingFaceLoader
Source§fn clone(&self) -> HuggingFaceLoader
fn clone(&self) -> HuggingFaceLoader
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Default for HuggingFaceLoader
impl Default for HuggingFaceLoader
Source§impl HfTokenTrait for HuggingFaceLoader
impl HfTokenTrait for HuggingFaceLoader
Auto Trait Implementations§
impl !Freeze for HuggingFaceLoader
impl !RefUnwindSafe for HuggingFaceLoader
impl !Sync for HuggingFaceLoader
impl !UnwindSafe for HuggingFaceLoader
impl Send for HuggingFaceLoader
impl Unpin for HuggingFaceLoader
impl UnsafeUnpin for HuggingFaceLoader
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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