Skip to main content

ConvertArgs

Struct ConvertArgs 

Source
pub struct ConvertArgs {
Show 14 fields pub inputs: Vec<PathBuf>, pub repo: Option<String>, pub format: Option<String>, pub file: Option<String>, pub revision: String, pub token: Option<String>, pub model_dir: Option<PathBuf>, pub output: PathBuf, pub dtype: DtypeArg, pub arch: Option<String>, pub name: Option<String>, pub metadata: Vec<String>, pub pickle_key: Option<String>, pub strip_prefix: Option<String>,
}

Fields§

§inputs: Vec<PathBuf>

Input checkpoint file(s): .safetensors (one or more shards), model.safetensors.index.json, .pt/.pth/.bin/.ckpt, .npy/.npz, .onnx, .h5/.hdf5, .keras, or .gguf (GGUF input re-quantizes and carries metadata through). TF SavedModel/checkpoints: see tools/export-weights.py. Omit if using –repo.

§repo: Option<String>

Download and convert directly from a HuggingFace repo (owner/name) instead of local files — whatever checkpoint format it’s published in.

§format: Option<String>

With –repo: which checkpoint format to fetch (safetensors, bin, pt, pth, ckpt, onnx, h5, hdf5, keras, npz, npy, gguf). Default: the highest-priority format actually present in the repo.

§file: Option<String>

With –repo: case-insensitive substring to pick among multiple files of the chosen format — e.g. a specific GGUF quant variant, or a safetensors file when the repo has no sharding index and ships several unrelated ones.

§revision: String

With –repo: branch, tag, or commit to fetch from.

§token: Option<String>

With –repo: HuggingFace API token, for gated/private repos.

§model_dir: Option<PathBuf>

With –repo: directory to download into. Default: models/<owner>__<name>.

§output: PathBuf

Output GGUF path.

§dtype: DtypeArg

Output dtype. Tensors too small for Q8_0 blocks fall back to F32.

§arch: Option<String>

Value for the general.architecture metadata key.

§name: Option<String>

Value for the general.name metadata key (default: first input’s file stem).

§metadata: Vec<String>

Extra metadata entries, key=value (repeatable). Values are parsed as bool / u32 / i32 / f32 when they look like one, else stored as strings.

§pickle_key: Option<String>

For pickle inputs: descend into this top-level dict (e.g. state_dict).

§strip_prefix: Option<String>

Strip this prefix from tensor names that carry it (e.g. model.).

Trait Implementations§

Source§

impl Args for ConvertArgs

Source§

fn group_id() -> Option<Id>

Report the [ArgGroup::id][crate::ArgGroup::id] for this set of arguments
Source§

fn augment_args<'b>(__clap_app: Command) -> Command

Append to [Command] so it can instantiate Self via [FromArgMatches::from_arg_matches_mut] Read more
Source§

fn augment_args_for_update<'b>(__clap_app: Command) -> Command

Append to [Command] so it can instantiate self via [FromArgMatches::update_from_arg_matches_mut] Read more
Source§

impl FromArgMatches for ConvertArgs

Source§

fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>

Instantiate Self from [ArgMatches], parsing the arguments as needed. Read more
Source§

fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>

Instantiate Self from [ArgMatches], parsing the arguments as needed. Read more
Source§

fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.
Source§

fn update_from_arg_matches_mut( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more