mirror of
https://github.com/huggingface/candle.git
synced 2025-06-19 19:58:35 +00:00

* implement wasm module * add example to workspace * add UI explore semantic similiarity * change status messages * formatting * minor changes
21 lines
557 B
Rust
21 lines
557 B
Rust
use candle_transformers::models::bert;
|
|
use wasm_bindgen::prelude::*;
|
|
|
|
pub use bert::{BertModel, Config, DTYPE};
|
|
pub use tokenizers::{PaddingParams, Tokenizer};
|
|
|
|
#[wasm_bindgen]
|
|
extern "C" {
|
|
// Use `js_namespace` here to bind `console.log(..)` instead of just
|
|
// `log(..)`
|
|
#[wasm_bindgen(js_namespace = console)]
|
|
pub fn log(s: &str);
|
|
}
|
|
|
|
#[macro_export]
|
|
macro_rules! console_log {
|
|
// Note that this is using the `log` function imported above during
|
|
// `bare_bones`
|
|
($($t:tt)*) => ($crate::log(&format_args!($($t)*).to_string()))
|
|
}
|