Views
No views yet
1import torch
2from peft import AutoPeftModelForCausalLM
3from transformers import AutoTokenizer, pipeline
4
5# Specify the model ID
6peft_model_id = "Menouar/phi-2-basic-maths"
7
8# Load Model with PEFT adapter
9model = AutoPeftModelForCausalLM.from_pretrained(
10 peft_model_id,
11 device_map="auto",
12 torch_dtype=torch.float16
13)
14
15tokenizer = AutoTokenizer.from_pretrained(peft_model_id)
16
17pipe = pipeline("text-generation", model=model, tokenizer=tokenizer)| Metric | Value |
|---|---|
| Avg. | 53.60 |
| AI2 Reasoning Challenge (25-Shot) | 55.80 |
| HellaSwag (10-Shot) | 71.15 |
| MMLU (5-Shot) | 47.27 |
| TruthfulQA (0-shot) | 41.40 |
| Winogrande (5-shot) | 75.30 |
| GSM8k (5-shot) | 30.71 |