Downloads · 30 days
19
18% of all-time downloads
avinashhm/llama-3.1-8b-dora-finetuned
llama-3.1-8b-dora-finetuned is a text generation model from avinashhm. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as apache-2.0.
- Developed by: avinashhm - License: apache-2.0 - Finetuned from model: devatar/quantizedLlama-3.1-8B-Instruct
Downloads · 30 days
19
18% of all-time downloads
All-time downloads
108
Public
Parameters
8.2B
5.9 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors11.6 GB · 98%
How the weights are stored.
U87.2B · 87%
From the Hugging Face model README
This model is a fine-tuned version of devatar/quantized_Llama-3.1-8B-Instruct, adapted using DoRA (Weight-Decomposed Low-Rank Adaptation) on a subset of the mlabonne/FineTome-100k dataset. It is optimized for instruction-following tasks, such as answering questions and explaining concepts, and was fine-tuned on a 40GB GPU with memory-efficient techniques.
mlabonne/FineTome-100k (5,000 samples)The model was trained on a 5,000-sample subset of mlabonne/FineTome-100k, which contains high-quality instruction-response pairs. Conversations were formatted as ### Human: ... ### Gpt: ... for training, covering tasks like explaining programming concepts and reasoning.
To use the model for inference:
from transformers import AutoTokenizer, AutoModelForCausalLM
model = AutoModelForCausalLM.from_pretrained("avinashhm/llama-3.1-8b-dora-finetuned", device_map="auto", torch_dtype=torch.bfloat16)
tokenizer = AutoTokenizer.from_pretrained("avinashhm/llama-3.1-8b-dora-finetuned")
inputs = tokenizer("Explain boolean operators in programming.", return_tensors="pt").to("cuda")
outputs = model.generate(**inputs, max_length=100)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
Note: The base model is 4-bit quantized, and merging DoRA adapters may introduce minor rounding errors in generations.
torchtransformerspefttrldatasetsbitsandbytesInstall dependencies:
pip install torch transformers datasets peft trl bitsandbytes
pip install git+https://github.com/huggingface/peft.git
trl version (pre-0.7.0), lacking features like max_seq_length.