CodeLlama 7B Python AI Assistant (QLoRA)

Fine-tuned CodeLlama-7B model specialized for Python programming assistance using QLoRA (Quantized Low-Rank Adaptation).

Model Description

  • Base Model: codellama/CodeLlama-7b-hf
  • Fine-tuning Method: QLoRA (4-bit quantization with LoRA adapters)
  • Framework: Unsloth + Transformers
  • Training Data: Custom Python programming examples

Usage

This repository contains LoRA adapters only. To use, merge the adapters with the base model.

from unsloth import FastLanguageModel

model, tokenizer = FastLanguageModel.from_pretrained( model_name="pranav-pvnn/codellama-7b-python-ai-assistant", max_seq_length=2048, load_in_4bit=True, )

prompt = "### Instruction:\nWrite a Python function to calculate factorial.\n### Response:\n" inputs = tokenizer(prompt, return_tensors="pt").to("cuda") outputs = model.generate(**inputs, max_new_tokens=256) print(tokenizer.decode(outputs, skip_special_tokens=True))

Training Details

  • Quantization: 4-bit
  • LoRA Rank: 64
  • Learning Rate: 2e-4
  • Epochs: 4
  • Max Seq Length: 2048
  • GPU: NVIDIA Tesla T4

Limitations

  • Requires base model for inference.
  • Optimized for Python code generation.
  • Trained on custom dataset (~2,000 examples).

Citation

@misc{codellama-7b-python-assistant, author = {pranav-pvnn}, title = {CodeLlama 7B Python AI Assistant}, year = {2025}, publisher = {HuggingFace}, howpublished = {\url{https://huggingface.co/pranav-pvnn/codellama-7b-python-ai-assistant}} }

Acknowledgements

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for pranav-pvnn/codellama-7b-python-ai-assistant-LoRA-adapters

Finetuned
(78)
this model