Views
No views yet
/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 |
1from unsloth import FastLanguageModel
2import torch
3
4model, tokenizer = FastLanguageModel.from_pretrained(
5 model_name = "CalmThinker/llama-3.1-8b-alpaca-finetune",
6 max_seq_length = 2048,
7 load_in_4bit = True,
8)
9FastLanguageModel.for_inference(model)
10
11alpaca_prompt = """Below is an instruction that describes a task. Write a response that appropriately completes the request.
12
13### Instruction:
14{}
15
16### Response:
17{}"""
18
19inputs = tokenizer([alpaca_prompt.format("Explain the concept of 'quantization error'.", "")], return_tensors="pt").to("cuda")
20outputs = model.generate(**inputs, max_new_tokens=128)
21print(tokenizer.batch_decode(outputs))