Views
No views yet

1import torch
2from transformers import AutoTokenizer, AutoModelForCausalLM
3
4model_path = 'ahxt/LiteLlama-460M-1T'
5
6model = AutoModelForCausalLM.from_pretrained(model_path)
7tokenizer = AutoTokenizer.from_pretrained(model_path)
8model.eval()
9
10prompt = 'Q: What is the largest bird?\nA:'
11input_ids = tokenizer(prompt, return_tensors="pt").input_ids
12tokens = model.generate(input_ids, max_length=20)
13print( tokenizer.decode(tokens[0].tolist(), skip_special_tokens=True) )
14# Q: What is the largest bird?\nA: The largest bird is a black-headed gull.| 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 |
| LiteLlama-460M-1T | 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 |