Views
No views yet
pip install transformers peft torch1from transformers import AutoTokenizer, AutoModelForCausalLM
2from peft import PeftModel
3
4base = "unsloth/Ministral-3-3B-Instruct-2512"
5adapter = "CanisAI/teach-humanities-ministral-3b-r2"
6
7tokenizer = AutoTokenizer.from_pretrained(base, use_fast=True)
8model = AutoModelForCausalLM.from_pretrained(
9 base,
10 device_map="auto",
11 torch_dtype="auto"
12)
13model = PeftModel.from_pretrained(model, adapter)
14
15# Example prompt
16prompt = "What were the main causes of the French Revolution?"
17inputs = tokenizer.apply_chat_template(
18 [{"role": "user", "content": prompt}],
19 add_generation_prompt=True,
20 return_tensors="pt"
21).to(model.device)
22
23outputs = model.generate(
24 inputs,
25 max_new_tokens=512,
26 temperature=0.7,
27 top_p=0.8,
28 top_k=40,
29 do_sample=True
30)
31print(tokenizer.decode(outputs[0], skip_special_tokens=True))| Type | Repository | Description |
|---|---|---|
| LoRA Adapters | CanisAI/teach-humanities-ministral-3b-r2 | This repository (lightweight) |
| Merged Model | (Coming Soon) | Ready-to-use full model |
| GGUF Quantized | (Coming Soon) | Ollama/llama.cpp compatible |
| Dataset | CanisAI/teach-humanities-v1 | Training data |
1@misc{canis-teach-teach-humanities,
2 title={Canis.teach Humanities Tutor},
3 author={CanisAI},
4 year={2026},
5 publisher={Hugging Face},
6 howpublished={\url{https://huggingface.co/CanisAI/teach-humanities-ministral-3b-r2}}
7}