pub struct Model { /* private fields */ }Expand description
Streaming zipformer transducer speech recognition model.
Implementations§
Source§impl Model
impl Model
Sourcepub async fn from_pretrained<S: AsRef<str>>(model: S) -> Result<Config>
Available on crate feature download-models only.
pub async fn from_pretrained<S: AsRef<str>>(model: S) -> Result<Config>
download-models only.Create a Config from a pretrained model on huggingface.
use sherpa_transducers::asr;
let model = asr::Model::from_pretrained("nytopop/nemo-conformer-transducer-en-80ms")
.await?
.build()?;Sourcepub async fn from_pretrained_arch<S>(
model: S,
arch: Arch,
tokens: S,
) -> Result<Config>
Available on crate feature download-models only.
pub async fn from_pretrained_arch<S>( model: S, arch: Arch, tokens: S, ) -> Result<Config>
download-models only.Create a Config from a pretrained ASR model on huggingface without a config.json.
Sourcepub fn online_stream(&self) -> Result<OnlineStream>
pub fn online_stream(&self) -> Result<OnlineStream>
Make an OnlineStream for incremental speech recognition.
Sourcepub fn phased_stream(&self, n_phase: usize) -> Result<PhasedStream>
pub fn phased_stream(&self, n_phase: usize) -> Result<PhasedStream>
Make a PhasedStream for incremental speech recognition.
Trades off increased compute utilization for lower latency transcriptions (sub chunk size).
Sourcepub fn sample_rate(&self) -> usize
pub fn sample_rate(&self) -> usize
Returns the native sample rate.
Sourcepub fn chunk_size(&self) -> usize
pub fn chunk_size(&self) -> usize
Returns the chunk size at the native sample rate.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Model
impl RefUnwindSafe for Model
impl Send for Model
impl Sync for Model
impl Unpin for Model
impl UnwindSafe for Model
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