Instructions to use Mwanzau/Mazgu_Llama-1B-V2-Knowledge with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use Mwanzau/Mazgu_Llama-1B-V2-Knowledge with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("Mwanzau/Mazgu_Llama-1B-V2-SFT-Merged") model = PeftModel.from_pretrained(base_model, "Mwanzau/Mazgu_Llama-1B-V2-Knowledge") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- Unsloth Studio
How to use Mwanzau/Mazgu_Llama-1B-V2-Knowledge with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for Mwanzau/Mazgu_Llama-1B-V2-Knowledge to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for Mwanzau/Mazgu_Llama-1B-V2-Knowledge to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for Mwanzau/Mazgu_Llama-1B-V2-Knowledge to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="Mwanzau/Mazgu_Llama-1B-V2-Knowledge", max_seq_length=2048, )
Mazgu_Llama-1B-V2 (LoRA Adapters)
This repository contains fine-tuned LoRA (Low-Rank Adaptation) adapter weights for unsloth/Llama-3.2-1B-Instruct. The model has been trained via Knowledge-SFT to improve instruction adherence, factual grounding, and technical domain fluency in Tumbuka.
๐ ๏ธ Usage with PEFT & Unsloth
To load these adapters on top of the base model using unsloth or standard Hugging Face Transformers:
import torch
from unsloth import FastLanguageModel
# 1. Load Base Model & Attach Adapters
model, tokenizer = FastLanguageModel.from_pretrained(
model_name = "Mwanzau/Mazgu_Llama-1B-V2", # Automatically fetches base + adapters
max_seq_length = 2048,
load_in_4bit = True,
)
FastLanguageModel.for_inference(model)
# 2. Formulate Prompt (Alpaca / Instruction Format)
prompt = """### Instruction:
Longosolani vyakurya ivyo vili bwino ku munda.
### Response:
"""
inputs = tokenizer([prompt], return_tensors="pt").to("cuda")
# 3. Generate
outputs = model.generate(
**inputs,
max_new_tokens = 150,
temperature = 0.6,
repetition_penalty = 1.2
)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
### ๐๏ธ Training Parameters
Framework: Unsloth / PEFT
Rank ($r$): 16
Alpha ($\alpha$): 16
Training Steps: 500 Knowledge-SFT steps
Dataset Format: Alpaca Instruction-Response (### Instruction: / ### Response:)
Focus: Grounded domain factual recall (Agriculture, literature, Tumbuka linguistics).
- Downloads last month
- 46
Model tree for Mwanzau/Mazgu_Llama-1B-V2-Knowledge
Base model
meta-llama/Llama-3.2-1B-Instruct Finetuned
unsloth/Llama-3.2-1B-Instruct