You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
None => anyhow::bail!("At least any of `max_position_embeddings` or `max_trained_positions` (only applies for NomicBERT), in that order of priority, should be defined in `config.json`."),
210
+
},
211
+
};
212
+
205
213
let base_input_length = match st_config {
206
214
Some(config) => config.max_seq_length,
207
215
None => {
208
216
tracing::warn!("Could not find a Sentence Transformers config");
209
-
config.max_position_embeddings - position_offset
217
+
max_position_embeddings - position_offset
210
218
}
211
219
};
212
220
@@ -461,8 +469,12 @@ fn get_backend_model_type(
461
469
pubstructModelConfig{
462
470
pubarchitectures:Vec<String>,
463
471
pubmodel_type:String,
464
-
#[serde(alias = "n_positions")]
465
-
pubmax_position_embeddings:usize,
472
+
// NOTE: `max_trained_positions` is specific for NomicBERT when it required custom code, but
473
+
// since Transformers v5 it's no longer required, and it now defines `max_position_embeddings`
474
+
// in the `config.json` instead. Not included as an `alias` since both can be present at the
475
+
// same time, see https://huggingface.co/nomic-ai/nomic-embed-text-v1.5/blob/e9b6763023c676ca8431644204f50c2b100d9aab/config.json#L33-L34
0 commit comments