Downloads · 30 days
4
5% of all-time downloads
Arinkc/pydoc-llama-r16-full
pydoc-llama-r16-full is a machine learning model from Arinkc. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for peft. The card lists the license as mit.
LoRA adapter for Llama 3.1 8B fine-tuned on Python docstring generation.
Downloads · 30 days
4
5% of all-time downloads
All-time downloads
87
Public
Repo size
185 MB
Likes
1
Public
Click a slice to open those files.
.safetensors168 MB · 91%
From the Hugging Face model README
LoRA adapter for Llama 3.1 8B fine-tuned on Python docstring generation.
| Metric | Base | Fine-Tuned |
|---|---|---|
| Hallucinated exceptions | 11% | 0% |
| Verbose outputs (>80 words) | 19.5% | 0% |
| Format compliance | 80.5% | 100% |
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()