Skip to content

Commit

Permalink
change DTypes (fixes #2355)
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobhq committed Jul 28, 2024
1 parent 0f5cbb0 commit d9bebe4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions candle-wasm-examples/bert/src/bin/m.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()))?;
Expand Down Expand Up @@ -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)]
Expand Down

0 comments on commit d9bebe4

Please sign in to comment.