Re-organize the wasm examples (#231)

* Move the whisper example.

* More renaming.

* Add llama2 as a new wasm example.

* Live generation.

* More of the llama wasm example.

* Formatting.
This commit is contained in:
Laurent Mazare
2023-07-24 12:36:02 +01:00
committed by GitHub
parent 550a13a547
commit 5a26cba733
22 changed files with 988 additions and 18 deletions

View File

@ -0,0 +1,30 @@
#![allow(dead_code)]
pub const WITH_TIMER: bool = true;
struct Timer {
label: &'static str,
}
impl Timer {
fn new(label: &'static str) -> Self {
if WITH_TIMER {
web_sys::console::time_with_label(label);
}
Self { label }
}
}
impl Drop for Timer {
fn drop(&mut self) {
if WITH_TIMER {
web_sys::console::time_end_with_label(self.label)
}
}
}
mod app;
mod model;
mod worker;
pub use app::App;
pub use worker::Worker;