Downloads · 30 days
16
17% of all-time downloads
CalmThinker/llama-3.1-8b-alpaca-finetune
llama-3.1-8b-alpaca-finetune is a machine learning model from CalmThinker. 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 llama3.1.
Downloads · 30 days
16
17% of all-time downloads
All-time downloads
96
Public
Repo size
21.2 GB
Likes
1
Public
Click a slice to open those files.
.safetensors16.2 GB · 77%
From the Hugging Face model README
license: llama3.1
base_model: unsloth/meta-llama-3.1-8b-bnb-4bit
tags:
datasets:
metrics:
This model is a fine-tuned version of Meta-Llama-3.1-8B, optimized using Unsloth and QLoRA for superior instruction-following performance. It was trained on an NVIDIA L4 GPU for 2 epochs using the Alpaca-cleaned dataset.
The following metrics were captured at the end of the training session:
This repository is organized into three distinct deployment formats:
/merged_16bit: Full 16-bit Safetensors. Ideal for AWS Bedrock Custom Model Import and Amazon SageMaker./gguf: 4-bit quantized format (Meta-Llama-3.1-8B.Q4_K_M.gguf). Optimized for Ollama, llama.cpp, and local VM deployment./adapters: Raw LoRA adapters. Best for version control or continued incremental fine-tuning.| Parameter | Value |
|---|---|
| LoRA Rank (r) | 16 |
| LoRA Alpha | 32 |
| Learning Rate | 2e-4 |
| LR Scheduler | Cosine Decay |
| Optimizer | AdamW 8-bit |
| Weight Decay | 0.01 |
| Max Seq Length | 2048 |
from unsloth import FastLanguageModel
import torch
model, tokenizer = FastLanguageModel.from_pretrained(
model_name = "CalmThinker/llama-3.1-8b-alpaca-finetune",
max_seq_length = 2048,
load_in_4bit = True,
)
FastLanguageModel.for_inference(model)
alpaca_prompt = """Below is an instruction that describes a task. Write a response that appropriately completes the request.
### Instruction:
{}
### Response:
{}"""
inputs = tokenizer([alpaca_prompt.format("Explain the concept of 'quantization error'.", "")], return_tensors="pt").to("cuda")
outputs = model.generate(**inputs, max_new_tokens=128)
print(tokenizer.batch_decode(outputs))