Views
No views yet
### 📋 Overview
This model, `llama-3.2-3b-instruct-bitcoin-analyst_best`, is a fine-tuned version of the **Llama-3.2-3B-Instruct** large language model. It has been specialized for the domain of **Bitcoin analysis and cryptocurrency**. The goal of this fine-tuning was to enhance the model's ability to provide detailed, accurate, and contextually relevant information about Bitcoin, blockchain technology, market trends, and related topics, acting as a virtual Bitcoin analyst.
The fine-tuning was performed using **QLoRA** on the `tahamajs/bitcoin-llm-finetuning-dataset` dataset.
### 🚀 Usage
You can easily use this model with the `transformers` library. The fine-tuned weights are stored as a PEFT adapter.
```python
import torch
from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer
# Load the base model
base_model_id = "meta-llama/Llama-3.2-3B-Instruct"
tokenizer = AutoTokenizer.from_pretrained(base_model_id)
base_model = AutoModelForCausalLM.from_pretrained(
base_model_id,
device_map="auto",
torch_dtype=torch.bfloat16,
)
# Load the fine-tuned adapter
peft_model_id = "tahamajs/llama-3.2-3b-instruct-bitcoin-analyst_best"
model = PeftModel.from_pretrained(base_model, peft_model_id)
# Example inference
prompt = "What are the key differences between Bitcoin and Ethereum?"
messages = [
{"role": "user", "content": prompt}
]
input_ids = tokenizer.apply_chat_template(
messages,
add_generation_prompt=True,
return_tensors="pt"
).to(model.device)
outputs = model.generate(input_ids=input_ids, max_new_tokens=256)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))meta-llama/Llama-3.2-3B-Instructtahamajs/bitcoin-llm-finetuning-datasettrl.SFTTrainer| Hyperparameter | Value |
|---|---|
num_train_epochs | 1 |
per_device_train_batch_size | 1 |
gradient_accumulation_steps | 2 |
learning_rate | 2e-4 |
optim | paged_adamw_32bit |
bf16 | True |
max_grad_norm | 0.3 |
r (LoRA rank) | 16 |
lora_alpha | 16 |