Wasm llama2 tweaks (#309)

* Clean-up the llama2.c wasm example.

* Use a proper tokenizer.
This commit is contained in:
Laurent Mazare
2023-08-02 15:49:43 +01:00
committed by GitHub
parent 4f17290ce0
commit 186c308d51
6 changed files with 14 additions and 52 deletions

View File

@ -1,28 +1,3 @@
#![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;