swarm-stt: the speech-to-text core (hash cache, shared runs, ffmpeg and whisper-cli engine)
This commit is contained in:
parent
5443c1c9ba
commit
df4b2f1838
1 changed files with 663 additions and 0 deletions
20
swarm-stt/src/lib.rs
Normal file
20
swarm-stt/src/lib.rs
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
//! The speech-to-text core of the swarm's `swarm-stt` service.
|
||||
//!
|
||||
//! [`Service::transcribe`] takes the bytes of a voice memo and answers its
|
||||
//! text. Three things stand between the bytes and the engine:
|
||||
//!
|
||||
//! - a size cap, so one oversized file cannot occupy the engine;
|
||||
//! - a cache keyed by the SHA-256 of the bytes, so the same memo sent to
|
||||
//! several agents is transcribed once ([`cache`]); and
|
||||
//! - an in-flight map, so two requests for one memo that arrive together share
|
||||
//! one engine run instead of starting two.
|
||||
//!
|
||||
//! The engine is behind the [`Engine`] trait. [`engine::Whisper`] decodes with
|
||||
//! `ffmpeg` and transcribes with `whisper-cli`; the tests use a fake.
|
||||
|
||||
pub mod cache;
|
||||
pub mod engine;
|
||||
mod service;
|
||||
|
||||
pub use engine::Engine;
|
||||
pub use service::{Config, Error, Reply, Service};
|
||||
Loading…
Reference in a new issue