Views
No views yet
CapraMind-V1-small is a lightweight, domain-specific language model fine-tuned on high-quality dairy goat husbandry knowledge. It provides accurate, safe, and practical guidance on nutrition, reproduction, disease prevention, milking, and daily management—tailored for farmers, veterinarians, and agricultural extension workers.
pip install transformers accelerate torch sentencepiece1from transformers import AutoTokenizer, AutoModelForCausalLM
2
3model_name = "CapraMind-V1-small"
4
5tokenizer = AutoTokenizer.from_pretrained(model_name, trust_remote_code=True)
6model = AutoModelForCausalLM.from_pretrained(
7 model_name,
8 trust_remote_code=True,
9 device_map="auto",
10 torch_dtype="auto"
11)
12model.eval()1prompt = "奶山羊产后瘫痪的紧急处理措施是什么?"
2messages = [
3 {"role": "system", "content": "你是一名资深奶山羊兽医,请基于专业规范回答。"},
4 {"role": "user", "content": prompt}
5]
6text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
7inputs = tokenizer(text, return_tensors="pt").to(model.device)
8
9outputs = model.generate(**inputs, max_new_tokens=256, do_sample=False)
10response = tokenizer.decode(outputs[0], skip_special_tokens=True)
11print(response)💡 Note: Use the Qwen chat template (tokenizer.apply_chat_template) for best results.
| Metric | Value |
|---|---|
| Final Training Loss | 1.55 |
| Validation Loss | 1.58 (on held-out 10% data) |
| Accuracy (Expert Eval, n=50) | 92% (factual correctness) |
| Hallucination Rate | 3% (mostly on rare diseases) |
Evaluated by 2 certified livestock veterinarians on real-world farmer questions.
⚠️ Important Note:
This model is built upon Qwen3-1.7B-Base, which is licensed under Alibaba’s Qwen License.
The MIT license applies only to the LoRA adapter weights and training code in this repository.
You must comply with Qwen3’s license terms when using or redistributing the base model.In practice:
- You may deploy CapraMind-V1-small in your app or service.
- But you must not redistribute Qwen3-1.7B-Base unless you comply with Alibaba’s terms (e.g., attribution, non-resale of base weights).
For commercial deployment, we recommend using only the LoRA adapter alongside a legally obtained Qwen3 base model.