Team Ai
Modelpublic

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

sourceHugging Faceapache-2.0updated 1y agoView on Hugging Face
0likes
Model Card

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.frompretrained( modelname="pranav-pvnn/codellama-7b-python-ai-assistant", maxseqlength=2048, loadin4bit=True, )

prompt = "### Instruction:\nWrite a Python function to calculate factorial.\n### Response:\n" inputs = tokenizer(prompt, returntensors="pt").to("cuda") outputs = model.generate(**inputs, maxnewtokens=256) print(tokenizer.decode(outputs, skipspecial_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