Skip to content

rbert fails to load answerdotai/ModernBERT-base #338

Description

@rectalogic

Problem

rbert fails to load https://huggingface.co/answerdotai/ModernBERT-base
It exits with Error: Failed to load config: missing field hidden_act at line 44 column 1

Steps To Reproduce

Run this:

use kalosm_model_types::FileSource;
use rbert::*;

#[tokio::main]
async fn main() -> anyhow::Result<()> {
    Bert::builder()
        .with_source(
            BertSource::default()
                .with_model(FileSource::huggingface(
                    "answerdotai/ModernBERT-base".to_string(),
                    "8949b909ec900327062f0ebf497f51aef5e6f0c8".to_string(),
                    "model.safetensors".to_string(),
                ))
                .with_tokenizer(FileSource::huggingface(
                    "answerdotai/ModernBERT-base".to_string(),
                    "8949b909ec900327062f0ebf497f51aef5e6f0c8".to_string(),
                    "tokenizer.json".to_string(),
                ))
                .with_config(FileSource::huggingface(
                    "answerdotai/ModernBERT-base".to_string(),
                    "8949b909ec900327062f0ebf497f51aef5e6f0c8".to_string(),
                    "config.json".to_string(),
                )),
        )
        .build()
        .await?;
    Ok(())
}

Expected behavior

Expected it to load.

Environment:

  • Crate version: [rbert 0.4.0]
  • Rust version: [1.85.0]
  • OS info: [macOS]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions