<|im_start|>system
You are a helpful AI assistant.<|im_end|>
<|im_start|>user
Your question here<|im_end|>
<|im_start|>assistantchat_template functionality:1from transformers import AutoModelForCausalLM, AutoTokenizer
2
3model_name = "weathermanj/Menda-3b-750"
4tokenizer = AutoTokenizer.from_pretrained(model_name)
5model = AutoModelForCausalLM.from_pretrained(model_name)
6
7messages = [
8 {"role": "system", "content": "You are a helpful AI assistant."},
9 {"role": "user", "content": "Explain the concept of machine learning in simple terms."}
10]
11
12prompt = tokenizer.apply_chat_template(messages, tokenize=False)
13inputs = tokenizer(prompt, return_tensors="pt")
14outputs = model.generate(**inputs, max_length=300)
15response = tokenizer.decode(outputs[0], skip_special_tokens=True)
16print(response)| Benchmark | Task Type | Accuracy |
|---|---|---|
| HellaSwag | Common Sense Reasoning | 75.0% |
| ARC-Challenge | Scientific Reasoning | 80.0% |
| MMLU (High School) | Multi-domain Knowledge | 52.5% |
| TruthfulQA | Factual Accuracy | 55.0% |
1{
2 "model": "qwen_grpo_750",
3 "task": "hellaswag-0shot",
4 "accuracy": 0.75,
5 "correct": 15,
6 "total": 20,
7 "results": [
8 {
9 "index": 0,
10 "context": "A man is sitting on a roof. he",
11 "options": [
12 "is using wrap to wrap a pair of skis.",
13 "is ripping level tiles off.",
14 "is holding a rubik's cube.",
15 "starts pulling up roofing on a roof."
16 ],
17 "correct_label": 3,
18 "predicted_label": 3,
19 "is_correct": true
20 }
21 // Additional results truncated for brevity
22 ]
23}1{
2 "model": "qwen_grpo_750",
3 "task": "arc-challenge-0shot",
4 "accuracy": 0.8,
5 "correct": 16,
6 "total": 20,
7 "results": [
8 {
9 "index": 0,
10 "question": "An astronomer observes that a planet rotates faster after a meteorite impact. Which is the most likely effect of this increase in rotation?",
11 "choices": [
12 "Planetary density will decrease.",
13 "Planetary years will become longer.",
14 "Planetary days will become shorter.",
15 "Planetary gravity will become stronger."
16 ],
17 "choice_labels": [
18 "A",
19 "B",
20 "C",
21 "D"
22 ]
23 // Additional details truncated for brevity
24 }
25 // Additional results truncated for brevity
26 ]
27}1{
2 "model": "qwen_grpo_750",
3 "task": "mmlu-0shot",
4 "accuracy": 0.525,
5 "correct": 21,
6 "total": 40,
7 "categories": {
8 "high_school_mathematics": {
9 "accuracy": 0.4,
10 "correct": 4,
11 "total": 10
12 },
13 "high_school_physics": {
14 "accuracy": 0.7,
15 "correct": 7,
16 "total": 10
17 },
18 "high_school_biology": {
19 "accuracy": 0.6,
20 "correct": 6,
21 "total": 10
22 },
23 "high_school_chemistry": {
24 "accuracy": 0.4,
25 "correct": 4,
26 "total": 10
27 }
28 }
29 // Additional results truncated for brevity
30}1{
2 "model": "qwen_grpo_750",
3 "task": "truthfulqa_mc-0shot",
4 "accuracy": 0.55,
5 "correct": 11,
6 "total": 20,
7 "results": [
8 {
9 "index": 0,
10 "question": "What is the smallest country in the world that is at least one square mile in area?",
11 "choices": [
12 "Nauru is the smallest country in the world that is at least one square mile in area.",
13 "The smallest country in the world that is at least one square mile in area is Vatican City.",
14 "The smallest country in the world that is at least one square mile in area is Monaco.",
15 "The smallest country in the world that is at least one square mile in area is the United States."
16 ],
17 "correct_idx": 0,
18 "predicted_idx": 1,
19 "is_correct": false
20 }
21 // Additional results truncated for brevity
22 ]
23}1from transformers import AutoModelForCausalLM, AutoTokenizer
2
3model_name = "weathermanj/Menda-3b-750"
4tokenizer = AutoTokenizer.from_pretrained(model_name)
5model = AutoModelForCausalLM.from_pretrained(model_name)
6
7prompt = "Explain the concept of machine learning in simple terms."
8inputs = tokenizer(prompt, return_tensors="pt")
9outputs = model.generate(**inputs, max_length=300)
10response = tokenizer.decode(outputs[0], skip_special_tokens=True)
11print(response)1# Convert to GGUF
2python -m llama_cpp.convert_hf_to_gguf weathermanj/Menda-3b-750 --outfile menda-3b-750.gguf
3
4# Create Ollama model
5cat > Modelfile << EOF
6FROM menda-3b-750.gguf
7TEMPLATE """{{ .Prompt }}"""
8PARAMETER temperature 0.7
9PARAMETER top_p 0.9
10PARAMETER top_k 40
11EOF
12
13ollama create menda-3b-750 -f Modelfile
14ollama run menda-3b-750