Instructions to use arthurblg1802/AntiBench-v2.1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use arthurblg1802/AntiBench-v2.1 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="arthurblg1802/AntiBench-v2.1", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("arthurblg1802/AntiBench-v2.1", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use arthurblg1802/AntiBench-v2.1 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "arthurblg1802/AntiBench-v2.1" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "arthurblg1802/AntiBench-v2.1", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/arthurblg1802/AntiBench-v2.1
- SGLang
How to use arthurblg1802/AntiBench-v2.1 with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "arthurblg1802/AntiBench-v2.1" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "arthurblg1802/AntiBench-v2.1", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "arthurblg1802/AntiBench-v2.1" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "arthurblg1802/AntiBench-v2.1", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use arthurblg1802/AntiBench-v2.1 with Docker Model Runner:
docker model run hf.co/arthurblg1802/AntiBench-v2.1
AntiBench v2.1
3m base general model heavily fine-tuned on wrong data, in HS and Q&A style.
Benchmarks
Zero-shot accuracy, full evaluation splits.
| Benchmark | Score |
|---|---|
| HellaSwag | 0.00% |
| ARC-Easy | 0.00% |
| ARC-Challenge | 0.00% |
| PIQA | 0.16% |
| ArithMark-3.0 | 0.00% |
| Open SLM index | โ51.51 |
Usage
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "arthurblg1802/AntiBench-v2.1"
tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(
model_id,
trust_remote_code=True,
dtype=torch.float32,
)
model.eval()
prompt = "The sun rises in the"
inputs = tokenizer(prompt, return_tensors="pt")
with torch.no_grad():
output = model.generate(**inputs, max_new_tokens=32, do_sample=False)
print(tokenizer.decode(output[0], skip_special_tokens=True))
Scoring a multiple-choice item the way the benchmarks above are scored:
import torch
import torch.nn.functional as F
def score(prompt, choice):
prompt_ids = tokenizer(prompt, add_special_tokens=False)["input_ids"]
ids = tokenizer(prompt + choice, add_special_tokens=False)["input_ids"]
x = torch.tensor([ids[:-1]])
t = torch.tensor(ids)
with torch.no_grad():
logits = model(input_ids=x).logits[0]
logprobs = F.log_softmax(logits, -1)
tok = logprobs[len(prompt_ids) - 1:len(ids) - 1].gather(1, t[len(prompt_ids):].unsqueeze(1)).squeeze(1)
return tok.mean().item() # mean log-likelihood per token: pick the highest of the choices
- Downloads last month
- 165