Downloads · 30 days
6
13% of all-time downloads
abhishekpatel10/Llama-2-7b-chat-finetune
Llama-2-7b-chat-finetune is a machine learning model from abhishekpatel10. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as apache-2.0.
This model is a fine-tuned version of TinyLlama/TinyLlama-1.1B-Chat-v1.0 on the mlabonne/guanaco-llama2-1k dataset.
Downloads · 30 days
6
13% of all-time downloads
All-time downloads
48
Public
Parameters
1.1B
825 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors825 MB · 100%
How the weights are stored.
U8969M · 86%
From the Hugging Face model README
This model is a fine-tuned version of TinyLlama/TinyLlama-1.1B-Chat-v1.0 on the mlabonne/guanaco-llama2-1k dataset.
It was trained using QLoRA (4-bit quantization) to be lightweight and efficient while maintaining conversational capabilities.
This model is intended for assistant-style chat interactions. Because it is a 1.1B parameter model, it may struggle with complex reasoning or long-form factual accuracy compared to larger models like Llama-3 70B.
The following hyperparameters were used during training:
You can use this model with the peft and transformers libraries:
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
import torch
base_model_id = "TinyLlama/TinyLlama-1.1B-Chat-v1.0"
adapter_id = "abhishekpatel10/Llama-2-7b-chat-finetune"
# Load base model and adapter
model = AutoModelForCausalLM.from_pretrained(base_model_id, torch_dtype=torch.float16, device_map="auto")
model = PeftModel.from_pretrained(model, adapter_id)
tokenizer = AutoTokenizer.from_pretrained(base_model_id)
# Generate text
prompt = "### Human: How do I bake a cake? ### Assistant:"
inputs = tokenizer(prompt, return_tensors="pt").to("cuda")
outputs = model.generate(**inputs, max_new_tokens=100)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))