pub struct HuggingFaceSource { /* private fields */ }Expand description
Hugging Face implementation of voxora_traits::ModelSource.
Cheap to clone (every field is Arc-shared), so callers should
hold it as Arc<HuggingFaceSource> and pass clones around.
Implementations§
Source§impl HuggingFaceSource
impl HuggingFaceSource
Sourcepub fn new() -> Result<Self, AsrError>
pub fn new() -> Result<Self, AsrError>
Construct a source with sensible defaults.
- Cache root:
$XDG_CACHE_HOME/voxora/models/huggingface. - Base URL:
https://huggingface.co. - Token:
HF_TOKENthenHUGGING_FACE_HUB_TOKEN(first non-empty wins). - User-Agent:
voxora-hf/<version>. - Timeout: 600 s per request.
Sourcepub fn builder() -> HuggingFaceSourceBuilder
pub fn builder() -> HuggingFaceSourceBuilder
Start configuring a source with non-default options.
Trait Implementations§
Source§impl Clone for HuggingFaceSource
impl Clone for HuggingFaceSource
Source§fn clone(&self) -> HuggingFaceSource
fn clone(&self) -> HuggingFaceSource
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 HuggingFaceSource
impl Debug for HuggingFaceSource
Source§impl ModelSource for HuggingFaceSource
impl ModelSource for HuggingFaceSource
Source§fn name(&self) -> &'static str
fn name(&self) -> &'static str
Short, stable identifier for this source
(
"huggingface", "local", …).Source§fn resolve<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
model_id: &'life1 str,
opts: &'life2 ResolveOptions,
) -> Pin<Box<dyn Future<Output = Result<ModelDir, AsrError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn resolve<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
model_id: &'life1 str,
opts: &'life2 ResolveOptions,
) -> Pin<Box<dyn Future<Output = Result<ModelDir, AsrError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Resolve a model id (e.g.
Qwen/Qwen3-ASR-0.6B) to a concrete
ModelDir on disk, downloading if necessary.Source§fn capabilities_for<'life0, 'life1, 'async_trait>(
&'life0 self,
model_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<ModelCapabilities, AsrError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn capabilities_for<'life0, 'life1, 'async_trait>(
&'life0 self,
model_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<ModelCapabilities, AsrError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Query a model’s capabilities without downloading the weights.
Source§fn list_available<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<ModelDescriptor>, AsrError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn list_available<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<ModelDescriptor>, AsrError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
List models known to this source. Defaults to
AsrError::Unsupported because not every source can enumerate.Auto Trait Implementations§
impl !RefUnwindSafe for HuggingFaceSource
impl !UnwindSafe for HuggingFaceSource
impl Freeze for HuggingFaceSource
impl Send for HuggingFaceSource
impl Sync for HuggingFaceSource
impl Unpin for HuggingFaceSource
impl UnsafeUnpin for HuggingFaceSource
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