Downloads · 30 days
14
18% of all-time downloads
chauben/advisorai-llama2-7b-stevens
advisorai-llama2-7b-stevens is a machine learning model from chauben. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for peft. The card lists the license as llama2.
A QLoRA fine-tuned version of LLaMA-2-7B adapted for academic advising at Stevens Institute of Technology, trained on 87,782 domain-specific Q&A pairs.
Downloads · 30 days
14
18% of all-time downloads
All-time downloads
80
Public
Repo size
480 MB
Likes
0
Public
Click a slice to open those files.
.pt320 MB · 66%
From the Hugging Face model README
A QLoRA fine-tuned version of LLaMA-2-7B adapted for academic advising at Stevens Institute of Technology, trained on 87,782 domain-specific Q&A pairs.
| Parameter | Value |
|---|---|
| Base Model | meta-llama/Llama-2-7b-hf |
| Method | QLoRA (4-bit NF4) |
| LoRA Rank / Alpha | 16 / 32 |
| Target Modules | q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj |
| Epochs | 6 |
| Learning Rate | 2e-4 |
| Effective Batch Size | 32 |
| Best Checkpoint | Step 7,500 |
| Training Platform | Google Colab GPU |
from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig from peft import PeftModel import torch
bnb_config = BitsAndBytesConfig( load_in_4bit=True, bnb_4bit_quant_type="nf4", bnb_4bit_compute_dtype=torch.float16 )
base = AutoModelForCausalLM.from_pretrained( "meta-llama/Llama-2-7b-hf", quantization_config=bnb_config, device_map="auto" )
model = PeftModel.from_pretrained(base, "nitinchaube/advisorai-llama2-7b-stevens") tokenizer = AutoTokenizer.from_pretrained("nitinchaube/advisorai-llama2-7b-stevens")
prompt = """### Context: {paste stevens context here}
What are the concentrations in the Applied Mathematics program?
inputs = tokenizer(prompt, return_tensors="pt").to("cuda") output = model.generate(**inputs, max_new_tokens=256, temperature=0.7) print(tokenizer.decode(output[0], skip_special_tokens=True))