mirror of
https://github.com/huggingface/candle.git
synced 2025-06-21 04:10:46 +00:00
Wasm llama2 tweaks (#309)
* Clean-up the llama2.c wasm example. * Use a proper tokenizer.
This commit is contained in:
@ -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;
|
||||
|
Reference in New Issue
Block a user