Instructions to use Arinkc/pydoc-llama-r16-full with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use Arinkc/pydoc-llama-r16-full with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("meta-llama/Llama-3.1-8B-Instruct") model = PeftModel.from_pretrained(base_model, "Arinkc/pydoc-llama-r16-full") - Notebooks
- Google Colab
- Kaggle
pydoc-llama-r16-full
LoRA adapter for Llama 3.1 8B fine-tuned on Python docstring generation.
Model Details
- Base model: meta-llama/Llama-3.1-8B-Instruct
- Fine-tuning method: QLoRA (4-bit NF4 + LoRA rank 16)
- Training data: Arinkc/pydoc-llama-codesearchnet-curated
- Training: 3 epochs, 22,473 examples, A100 GPU, 4h 51m
- Loss: 2.3 โ 0.63
Evaluation (200 held-out examples)
| Metric | Base | Fine-Tuned |
|---|---|---|
| Hallucinated exceptions | 11% | 0% |
| Verbose outputs (>80 words) | 19.5% | 0% |
| Format compliance | 80.5% | 100% |
Usage
from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig
from peft import PeftModel
import torch
BASE = "meta-llama/Llama-3.1-8B-Instruct"
ADAPTER = "Arinkc/pydoc-llama-r16-full"
bnb = BitsAndBytesConfig(load_in_4bit=True, bnb_4bit_quant_type="nf4",
bnb_4bit_compute_dtype=torch.bfloat16)
tokenizer = AutoTokenizer.from_pretrained(BASE)
model = PeftModel.from_pretrained(
AutoModelForCausalLM.from_pretrained(BASE, quantization_config=bnb, device_map="auto"),
ADAPTER,
)
model.eval()
Full Project
- Downloads last month
- 39
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐ Ask for provider support
Model tree for Arinkc/pydoc-llama-r16-full
Base model
meta-llama/Llama-3.1-8B Finetuned
meta-llama/Llama-3.1-8B-Instruct