mirror of
https://github.com/huggingface/candle.git
synced 2025-06-17 19:18:50 +00:00
Clippy fixes for 1.81.0. (#2461)
* Clippy fixes for 1.81.0. * Another fix.
This commit is contained in:
@ -419,7 +419,7 @@ struct BertEncoder {
|
||||
impl BertEncoder {
|
||||
fn load(vb: VarBuilder, config: &Config) -> Result<Self> {
|
||||
let layers = (0..config.num_hidden_layers)
|
||||
.map(|index| BertLayer::load(vb.pp(&format!("layer.{index}")), config))
|
||||
.map(|index| BertLayer::load(vb.pp(format!("layer.{index}")), config))
|
||||
.collect::<Result<Vec<_>>>()?;
|
||||
let span = tracing::span!(tracing::Level::TRACE, "encoder");
|
||||
Ok(BertEncoder { layers, span })
|
||||
@ -454,8 +454,8 @@ impl BertModel {
|
||||
(Err(err), _) | (_, Err(err)) => {
|
||||
if let Some(model_type) = &config.model_type {
|
||||
if let (Ok(embeddings), Ok(encoder)) = (
|
||||
BertEmbeddings::load(vb.pp(&format!("{model_type}.embeddings")), config),
|
||||
BertEncoder::load(vb.pp(&format!("{model_type}.encoder")), config),
|
||||
BertEmbeddings::load(vb.pp(format!("{model_type}.embeddings")), config),
|
||||
BertEncoder::load(vb.pp(format!("{model_type}.encoder")), config),
|
||||
) {
|
||||
(embeddings, encoder)
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user