Downloads · 30 days
3
5% of all-time downloads
Varun95/finetune-lama-vectordb
finetune-lama-vectordb is a text generation model from Varun95. Use it when you need the model to write or continue text. It is set up for peft. The card lists the license as apache-2.0.
This is a LoRA (Low‑Rank Adaptation) adapter for the unsloth/tinyllama-bnb-4bit base model. It has been fine‑tuned on a synthetic question‑answer dataset generated from the textbook "Physics of Black Holes" (2009). Th…
Downloads · 30 days
3
5% of all-time downloads
All-time downloads
63
Public
Repo size
9.5 MB
Likes
0
Public
Click a slice to open those files.
.safetensors9 MB · 69%
From the Hugging Face model README
This is a LoRA (Low‑Rank Adaptation) adapter for the unsloth/tinyllama-bnb-4bit base model.
It has been fine‑tuned on a synthetic question‑answer dataset generated from the textbook "Physics of Black Holes" (2009). The adapter enhances the model's ability to answer domain‑specific questions about general relativity, event horizons, Hawking radiation, and black hole thermodynamics.
unsloth/tinyllama-bnb-4bitThe adapter is meant to be used on top of the base TinyLlama model for retrieval‑augmented generation (RAG) or direct Q&A about black hole physics.
It works best when provided with context from the original textbook (e.g., via vector search).
from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer
# Load the quantized base model
base_model = AutoModelForCausalLM.from_pretrained(
"unsloth/tinyllama-bnb-4bit",
load_in_4bit=True,
device_map="auto"
)
tokenizer = AutoTokenizer.from_pretrained("unsloth/tinyllama-bnb-4bit")
tokenizer.pad_token = tokenizer.eos_token
# Load your LoRA adapter
model = PeftModel.from_pretrained(base_model, "Varun95/finetune-lama-vectordb")
# Inference
prompt = "What is a black hole?"
inputs = tokenizer(prompt, return_tensors="pt").to("cuda")
outputs = model.generate(**inputs, max_new_tokens=200)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))