mirror of
https://github.com/huggingface/candle.git
synced 2025-06-19 19:58:35 +00:00
Improve Whisper WASM UI example (#669)
* wip add module and js worker example * params * clean up, send error * final UI with whisper webworker * add simple instructions
This commit is contained in:
@ -222,7 +222,7 @@ impl Decoder {
|
||||
Ok(segments)
|
||||
}
|
||||
|
||||
fn load(md: ModelData) -> anyhow::Result<Self> {
|
||||
pub fn load(md: ModelData) -> anyhow::Result<Self> {
|
||||
let device = Device::Cpu;
|
||||
let tokenizer = Tokenizer::from_bytes(&md.tokenizer).map_err(anyhow::Error::msg)?;
|
||||
|
||||
@ -239,7 +239,7 @@ impl Decoder {
|
||||
Ok(decoder)
|
||||
}
|
||||
|
||||
fn convert_and_run(&self, wav_input: &[u8]) -> anyhow::Result<Vec<Segment>> {
|
||||
pub fn convert_and_run(&self, wav_input: &[u8]) -> anyhow::Result<Vec<Segment>> {
|
||||
let device = Device::Cpu;
|
||||
let mut wav_input = std::io::Cursor::new(wav_input);
|
||||
let (header, data) = wav::read(&mut wav_input)?;
|
||||
|
Reference in New Issue
Block a user