Views
No views yet
1import torch
2from transformers import AutoTokenizer, AutoModelForCausalLM
3
4# model_path = 'ahxt/llama2_xs_460M_experimental'
5model_path = 'ahxt/llama1_s_1.8B_experimental'
6
7model = AutoModelForCausalLM.from_pretrained(model_path)
8tokenizer = AutoTokenizer.from_pretrained(model_path)
9model.eval()
10
11prompt = 'Q: What is the largest bird?\nA:'
12input_ids = tokenizer(prompt, return_tensors="pt").input_ids
13tokens = model.generate(input_ids, max_length=20)
14print( tokenizer.decode(tokens[0].tolist(), skip_special_tokens=True) )
15# Q: What is the largest bird?\nA: The largest bird is the bald eagle.| Models | #parameters | zero-shot | 5-shot |
|---|---|---|---|
| llama | 7B | 28.46 | 35.05 |
| openllama | 3B | 24.90 | 26.71 |
| TinyLlama-1.1B-step-50K-105b | 1.1B | 19.00 | 26.53 |
| llama2_xs_460M | 0.46B | 21.13 | 26.39 |
| Metric | Value |
|---|---|
| Avg. | 26.65 |
| ARC (25-shot) | 24.91 |
| HellaSwag (10-shot) | 38.47 |
| MMLU (5-shot) | 26.17 |
| TruthfulQA (0-shot) | 41.59 |
| Winogrande (5-shot) | 49.88 |
| GSM8K (5-shot) | 0.0 |
| DROP (3-shot) | 5.51 |