stanfordnlp/snli
Viewer β’ Updated β’ 570k β’ 22.4k β’ 95
RoBERTa-large energy checkpoint used by LaSEr Edit for contradiction avoidance (NLI) locate and EBM edit.
This is not a standard transformers from_pretrained folder. LaSEr Edit loads it via EncoderModel + torch.load("best_model_pearsonr.pth").
Released under CC BY-NC 4.0 (attribution, non-commercial).
Upstream components (for attribution / awareness):
roberta-large (MIT)stanfordnlp/snli (CC BY-SA 4.0), nyu-mll/multi_nli (permissive / mixed), facebook/anli (CC BY-NC 4.0)Download the checkpoint, then load it with EncoderModel (not transformers.from_pretrained):
huggingface-cli download hayleyson/laser-edit-nli-energy --local-dir ./laser-edit-nli-energy
import json
import torch
from laser_edit.ebm_training.nli.models.encoder import EncoderModel
model_dir = "./laser-edit-nli-energy"
device = "cuda" if torch.cuda.is_available() else "cpu"
with open(f"{model_dir}/config.json") as f:
model_config = json.load(f)
model_config["device"] = device
model_config["model_path"] = f"{model_dir}/best_model_pearsonr.pth"
# optional locate mode used by LaSEr Edit: "gradnorm" or "attention"
model_config["locate"]["type"] = "gradnorm"
model = EncoderModel(params=model_config)
model.load_state_dict(
torch.load(model_config["model_path"], weights_only=True),
strict=False,
)
model.eval()
model.to(device)
tokenizer = model.tokenizer
Required files:
best_model_pearsonr.pth β trained energy network state dictconfig.json β LaSEr Edit EncoderModel config (energynet.base_model: roberta-large)classification_threshold.json β optional decision threshold file determined by optimizing a classification performance metric (e.g., precision, F1, recall) on the validation dataset; not used in the LaSEr-Edit paperFor training details, please refer to the LaSEr-Edit paper: LaSEr-Edit: Localized Span-level Error Editing with Energy-based Localization.
Base model
FacebookAI/roberta-large