pub enum ModelSource {
LocalDir(PathBuf),
HuggingFaceModelId(String),
}Expand description
Configuration of where embedding model artifacts come from.
This is intentionally minimal and testable: it just answers “local dir or hub id?”.
Variants§
LocalDir(PathBuf)
Load from a local directory containing config.json, tokenizer.json, model.safetensors.
HuggingFaceModelId(String)
Load via HuggingFace Hub model id (downloaded/cached by hf-hub).
Implementations§
Source§impl ModelSource
impl ModelSource
Sourcepub fn from_iksh_env() -> Self
👎Deprecated since 0.2.0: use from_embedd_env() or from_env_any()
pub fn from_iksh_env() -> Self
use from_embedd_env() or from_env_any()
Resolve from the legacy iksh environment variables.
Priority:
IKSH_EMBED_MODEL_DIR(local, no network)IKSH_EMBED_MODEL(hub model id)
Sourcepub fn from_embedd_env() -> Self
pub fn from_embedd_env() -> Self
Resolve from EMBEDD_MODEL_DIR / EMBEDD_MODEL env vars.
Falls back to the default model when unset.
Sourcepub fn from_env_any() -> Self
pub fn from_env_any() -> Self
Prefer EMBEDD_* model env vars, else fall back to IKSH_*, else defaults.
Trait Implementations§
Source§impl Clone for ModelSource
impl Clone for ModelSource
Source§fn clone(&self) -> ModelSource
fn clone(&self) -> ModelSource
Returns a duplicate of the value. Read more
1.0.0 · 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 ModelSource
impl Debug for ModelSource
Source§impl PartialEq for ModelSource
impl PartialEq for ModelSource
impl Eq for ModelSource
impl StructuralPartialEq for ModelSource
Auto Trait Implementations§
impl Freeze for ModelSource
impl RefUnwindSafe for ModelSource
impl Send for ModelSource
impl Sync for ModelSource
impl Unpin for ModelSource
impl UnsafeUnpin for ModelSource
impl UnwindSafe for ModelSource
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