Views
No views yet
<|im_start|>system
{system_message}<|im_end|>
<|im_start|>user
{user_message}<|im_end|>
<|im_start|>assistant1penalty_alpha: 0.5
2top_k: 4
3repetition_penalty: 1.011from transformers import pipeline
2
3generate = pipeline("text-generation", "Felladrin/Llama-160M-Chat-v1")
4
5messages = [
6 {
7 "role": "system",
8 "content": "You are a helpful assistant who answers user's questions with details and curiosity.",
9 },
10 {
11 "role": "user",
12 "content": "What are some potential applications for quantum computing?",
13 },
14]
15
16prompt = generate.tokenizer.apply_chat_template(
17 messages, tokenize=False, add_generation_prompt=True
18)
19
20output = generate(
21 prompt,
22 max_new_tokens=1024,
23 penalty_alpha=0.5,
24 top_k=4,
25 repetition_penalty=1.01,
26)
27
28print(output[0]["generated_text"])| Metric | Value |
|---|---|
| Avg. | 30.27 |
| AI2 Reasoning Challenge (25-Shot) | 24.74 |
| HellaSwag (10-Shot) | 35.29 |
| MMLU (5-Shot) | 26.13 |
| TruthfulQA (0-shot) | 44.16 |
| Winogrande (5-shot) | 51.30 |
| GSM8k (5-shot) | 0.00 |