#[non_exhaustive]pub struct ResolveOptions {
pub quantization: QuantizationPreference,
pub token: Option<String>,
pub revision: Option<String>,
}Expand description
Options controlling how ModelSource::resolve acquires a model.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.quantization: QuantizationPreferencePreferred quantization; the source may pick a different one if the preferred is not available for this model.
token: Option<String>Auth token, if the source requires one. For Hugging Face this
overrides the HF_TOKEN environment variable.
revision: Option<String>Specific git revision (branch, tag, or SHA) to pin the model to.
Implementations§
Source§impl ResolveOptions
impl ResolveOptions
Sourcepub fn with_revision(revision: impl Into<String>) -> Self
pub fn with_revision(revision: impl Into<String>) -> Self
Construct a ResolveOptions with the given revision;
everything else is Auto / None.
Sourcepub fn with_token(token: impl Into<String>) -> Self
pub fn with_token(token: impl Into<String>) -> Self
Construct a ResolveOptions with the given token;
everything else is Auto / None.
Trait Implementations§
Source§impl Clone for ResolveOptions
impl Clone for ResolveOptions
Source§fn clone(&self) -> ResolveOptions
fn clone(&self) -> ResolveOptions
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 Debug for ResolveOptions
impl Debug for ResolveOptions
Source§impl Default for ResolveOptions
impl Default for ResolveOptions
Source§fn default() -> ResolveOptions
fn default() -> ResolveOptions
Returns the “default value” for a type. Read more
impl Eq for ResolveOptions
Source§impl PartialEq for ResolveOptions
impl PartialEq for ResolveOptions
impl StructuralPartialEq for ResolveOptions
Auto Trait Implementations§
impl Freeze for ResolveOptions
impl RefUnwindSafe for ResolveOptions
impl Send for ResolveOptions
impl Sync for ResolveOptions
impl Unpin for ResolveOptions
impl UnsafeUnpin for ResolveOptions
impl UnwindSafe for ResolveOptions
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