Views
No views yet
[!IMPORTANT] This model uses ChatML template. Ensure you use the correct template:
<|im_start|>system
[System message]<|im_end|>
<|im_start|>user
[Your question or message]<|im_end|>
<|im_start|>assistant
[The model's response]<|im_end|>| Benchmark | 5-shot | 0-shot |
|---|---|---|
| ARC Challenge | 22.61 | 23.63 |
| ARC Easy | 37.16 | 40.49 |
| CommonsenseQA | 19.41 | 20.64 |
| HellaSWAG | 28.74 | 28.41 |
| MMLU | 25.20 | 23.45 |
| OpenBookQA | 27.40 | 28.60 |
| PIQA | 60.88 | 60.77 |
| Winogrande | 50.59 | 50.04 |
transformers library:1import torch
2from transformers import AutoModelForCausalLM, AutoTokenizer
3device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
4model = AutoModelForCausalLM.from_pretrained("OuteAI/Lite-Oute-1-65M-Instruct").to(device)
5tokenizer = AutoTokenizer.from_pretrained("OuteAI/Lite-Oute-1-65M-Instruct")
6def generate_response(message: str, temperature: float = 0.4, repetition_penalty: float = 1.12) -> str:
7 # Apply the chat template and convert to PyTorch tensors
8 messages = [
9 {"role": "system", "content": "You are a helpful assistant."},
10 {"role": "user", "content": message}
11 ]
12 input_ids = tokenizer.apply_chat_template(
13 messages, add_generation_prompt=True, return_tensors="pt"
14 ).to(device)
15 # Generate the response
16 output = model.generate(
17 input_ids,
18 max_length=512,
19 temperature=temperature,
20 repetition_penalty=repetition_penalty,
21 do_sample=True
22 )
23 # Decode the generated output
24 generated_text = tokenizer.decode(output[0], skip_special_tokens=True)
25 return generated_text
26message = "I'd like to learn about language models. Can you break down the concept for me?"
27response = generate_response(message)
28print(response)