hharsha/agentic-systems-showcase
Viewer • Updated • 16 • 28
How to use hharsha/agentic-rag-lora with PEFT:
from peft import PeftModel
from transformers import AutoModelForCausalLM
base_model = AutoModelForCausalLM.from_pretrained("HuggingFaceTB/SmolLM-135M")
model = PeftModel.from_pretrained(base_model, "hharsha/agentic-rag-lora")LoRA adapter only (not full base weights) for HuggingFaceTB/SmolLM-135M,
lightly trained on CPU with short instruction/response texts about agentic systems and RAG.
Comparison note: This is a tiny PEFT adapter (~SmolLM-135M base), not a 4-bit 7B chat model and not a paid Gradio Space. Load the base model, then attach this adapter.
from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer
base = "HuggingFaceTB/SmolLM-135M"
tok = AutoTokenizer.from_pretrained("hharsha/agentic-rag-lora")
model = AutoModelForCausalLM.from_pretrained(base)
model = PeftModel.from_pretrained(model, "hharsha/agentic-rag-lora")
prompt = "Explain hybrid search in a RAG pipeline:"
inputs = tok(prompt, return_tensors="pt")
print(tok.decode(model.generate(**inputs, max_new_tokens=64)[0], skip_special_tokens=True))
| Base | HuggingFaceTB/SmolLM-135M |
| Method | PEFT LoRA (r=8, alpha=16, q_proj/v_proj) |
| Epochs | 1 (CPU, float32) |
| Trainable params | ~461k (0.34%) |
| Data | Showcase project summaries + synthetic agentic/RAG instructions |
hharsha/agentic-systems-minilmhharsha/agentic-github-taggerhharsha/agentic-systems-showcasehharsha/agentic-github-metaBase model
HuggingFaceTB/SmolLM-135M