summaryrefslogtreecommitdiff
path: root/candle-wasm-examples/bert/src/bin/m.rs
diff options
context:
space:
mode:
Diffstat (limited to 'candle-wasm-examples/bert/src/bin/m.rs')
-rw-r--r--candle-wasm-examples/bert/src/bin/m.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/candle-wasm-examples/bert/src/bin/m.rs b/candle-wasm-examples/bert/src/bin/m.rs
index 67d85e71..92617f15 100644
--- a/candle-wasm-examples/bert/src/bin/m.rs
+++ b/candle-wasm-examples/bert/src/bin/m.rs
@@ -18,7 +18,7 @@ impl Model {
console_error_panic_hook::set_once();
console_log!("loading model");
let device = &Device::Cpu;
- let vb = VarBuilder::from_buffered_safetensors(weights, DType::F64, device)?;
+ let vb = VarBuilder::from_buffered_safetensors(weights, DType::F32, device)?;
let config: Config = serde_json::from_slice(&config)?;
let tokenizer =
Tokenizer::from_bytes(&tokenizer).map_err(|m| JsError::new(&m.to_string()))?;
@@ -78,7 +78,7 @@ impl Model {
#[derive(serde::Serialize, serde::Deserialize)]
struct Embeddings {
- data: Vec<Vec<f64>>,
+ data: Vec<Vec<f32>>,
}
#[derive(serde::Serialize, serde::Deserialize)]