Skip to content

Commit b666d0e

Browse files
committed
Fix linting and update code-comment
1 parent 1a59eaf commit b666d0e

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

backends/candle/src/lib.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -470,19 +470,19 @@ impl CandleBackend {
470470
}
471471
};
472472

473-
// If `2_Dense/model.safetensors` is amongst the downloaded artifacts, then create a Linear
474-
// layer from the VarBuilder using `candle` to provide it as an extra `Dense` layer to the
475-
// `CandleBackend`, otherwise leave it as None
473+
// If `2_Dense/model.safetensors` is amongst the downloaded artifacts, then create a Dense
474+
// block and provide it to the `CandleBackend`, otherwise, None
476475
let dense = if model_path.join("2_Dense/model.safetensors").exists() {
477476
let dense_config_path = model_path.join("2_Dense/config.json");
478477

479-
// Load dense config
480478
let dense_config_str = std::fs::read_to_string(&dense_config_path).map_err(|err| {
481-
BackendError::Start(format!("Unable to read dense config file: {err:?}"))
479+
BackendError::Start(format!(
480+
"Unable to read `2_Dense/config.json` file: {err:?}"
481+
))
482482
})?;
483483
let dense_config: DenseConfig =
484484
serde_json::from_str(&dense_config_str).map_err(|err| {
485-
BackendError::Start(format!("Unable to parse dense config: {err:?}"))
485+
BackendError::Start(format!("Unable to parse `2_Dense/config.json`: {err:?}"))
486486
})?;
487487

488488
let dense_path = model_path.join("2_Dense/model.safetensors");
@@ -498,7 +498,7 @@ impl CandleBackend {
498498
Ok(Self {
499499
device,
500500
model: model?,
501-
dense: dense,
501+
dense,
502502
})
503503
}
504504
}

0 commit comments

Comments
 (0)