Views
No views yet
<|im_start|> and <|im_end|>)<|im_start|>system
{system_message}<|im_end|>
<|im_start|>user
{user_message}<|im_end|>
<|im_start|>assistant1penalty_alpha: 0.5
2top_k: 51from transformers import pipeline
2
3generate = pipeline("text-generation", "Felladrin/TinyMistral-248M-Chat-v2")
4
5messages = [
6 {
7 "role": "system",
8 "content": "You are a highly knowledgeable and friendly assistant. Your goal is to understand and respond to user inquiries with clarity. Your interactions are always respectful, helpful, and focused on delivering the most accurate information to the user.",
9 },
10 {
11 "role": "user",
12 "content": "Hey! Got a question for you!",
13 },
14 {
15 "role": "assistant",
16 "content": "Sure! What's it?",
17 },
18 {
19 "role": "user",
20 "content": "What are some potential applications for quantum computing?",
21 },
22]
23
24prompt = generate.tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
25
26output = generate(
27 prompt,
28 max_new_tokens=256,
29 penalty_alpha=0.5,
30 top_k=5,
31)
32
33print(output[0]["generated_text"])| Hyperparameter | Value |
|---|---|
| Learning rate | 2e-5 |
| Total train batch size | 32 |
| Max. sequence length | 2048 |
| Weight decay | 0.01 |
| Warmup ratio | 0.1 |
| NEFTune Noise Alpha | 5 |
| Optimizer | Adam with betas=(0.9,0.999) and epsilon=1e-08 |
| Scheduler | cosine |
| Seed | 42 |
| Metric | Value |
|---|---|
| Avg. | 27.42 |
| AI2 Reasoning Challenge (25-Shot) | 23.29 |
| HellaSwag (10-Shot) | 27.39 |
| MMLU (5-Shot) | 23.52 |
| TruthfulQA (0-shot) | 41.32 |
| Winogrande (5-shot) | 49.01 |
| GSM8k (5-shot) | 0.00 |