File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -470,19 +470,19 @@ impl CandleBackend {
470
470
}
471
471
} ;
472
472
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
476
475
let dense = if model_path. join ( "2_Dense/model.safetensors" ) . exists ( ) {
477
476
let dense_config_path = model_path. join ( "2_Dense/config.json" ) ;
478
477
479
- // Load dense config
480
478
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
+ ) )
482
482
} ) ?;
483
483
let dense_config: DenseConfig =
484
484
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:?}" ) )
486
486
} ) ?;
487
487
488
488
let dense_path = model_path. join ( "2_Dense/model.safetensors" ) ;
@@ -498,7 +498,7 @@ impl CandleBackend {
498
498
Ok ( Self {
499
499
device,
500
500
model : model?,
501
- dense : dense ,
501
+ dense,
502
502
} )
503
503
}
504
504
}
You can’t perform that action at this time.
0 commit comments