Instructions to use pranav-pvnn/codellama-7b-python-ai-assistant-LoRA-adapters with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Local Apps Settings
- Unsloth Studio
How to use pranav-pvnn/codellama-7b-python-ai-assistant-LoRA-adapters with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for pranav-pvnn/codellama-7b-python-ai-assistant-LoRA-adapters to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for pranav-pvnn/codellama-7b-python-ai-assistant-LoRA-adapters to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for pranav-pvnn/codellama-7b-python-ai-assistant-LoRA-adapters to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="pranav-pvnn/codellama-7b-python-ai-assistant-LoRA-adapters", max_seq_length=2048, )
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
- Base Model: Meta's CodeLlama
- Training Framework: Unsloth
- Quantization: bitsandbytes
- LoRA: PEFT
Model tree for pranav-pvnn/codellama-7b-python-ai-assistant-LoRA-adapters
Base model
codellama/CodeLlama-7b-hf