Views
No views yet
answerdotai/ModernBERT-base,
and inherits the base encoder's maximum context length and tokenizer.
ModernBERT-base pairs a fast, memory-efficient encoder with strong long-context fine-tuning and inference characteristics. It supports long inputs without requiring manual global attention masks, making it a drop-in replacement for standard encoder classifiers.0 / no_screenshot: do not call the screenshot tool.1 / take_screenshot: call the screenshot tool.1USER: I'm wondering if blue goes well with yellow.
2USER: What's your take on this?take_screenshot probability to decide
whether to trigger the tool."USER:". Multi-turn conversations therefore become multiple training examples
with growing context.1from transformers import AutoTokenizer, AutoModelForSequenceClassification
2
3MODEL_ID = "yapwithai/yap-modernbert-screenshot-intent"
4
5tokenizer = AutoTokenizer.from_pretrained(MODEL_ID)
6model = AutoModelForSequenceClassification.from_pretrained(MODEL_ID)
7model.eval()
8
9text = "USER: look at this amazing sunset"
10inputs = tokenizer(
11 text,
12 return_tensors="pt",
13 truncation=True,
14 padding="max_length",
15 max_length=1536,
16)
17
18with torch.no_grad():
19 outputs = model(**inputs)
20 probs = outputs.logits.softmax(dim=-1)[0]
21
22p_no, p_yes = probs.tolist()
23print("P(no_screenshot)=", p_no)
24print("P(take_screenshot)=", p_yes)p_yes to decide whether to trigger the screenshot tool.1@misc{modernbert,
2 title={Smarter, Better, Faster, Longer: A Modern Bidirectional Encoder for Fast, Memory Efficient, and Long Context Finetuning and Inference},
3 author={Benjamin Warner and Antoine Chaffin and Benjamin Clavié and Orion Weller and Oskar Hallström and Said Taghadouini and Alexis Gallagher and Raja Biswas and Faisal Ladhak and Tom Aarsen and Nathan Cooper and Griffin Adams and Jeremy Howard and Iacopo Poli},
4 year={2024},
5 eprint={2412.13663},
6 archivePrefix={arXiv},
7 primaryClass={cs.CL},
8 url={https://arxiv.org/abs/2412.13663},
9}