rishini's picture
Add training and evaluation scripts
f238825 verified
|
Raw
History Blame Contribute Delete
1.3 kB
# Finetune + Eval Scripts
Scripts used to train and evaluate the adapters in this repo.
## Environment
```bash
python3 -m venv /home/ai/llama-finetune-env
/home/ai/llama-finetune-env/bin/pip install torch transformers accelerate peft bitsandbytes trl datasets huggingface_hub
```
GPU note: GPU 0 is occupied by vLLM; both scripts pin `CUDA_VISIBLE_DEVICES=1`.
## Programming model (this repo)
- `programming_finetune_aggressive.py` — trains `rishini/qwen2.5-coder-7b-programming-lora`
- Base: `Qwen/Qwen2.5-Coder-7B-Instruct`, LoRA r=64 alpha=128, 6k filtered CodeAlpaca examples, 3 epochs, completion-only masking.
- Output dir: `/home/ai/qwen-coder-programming-best`
- `eval_best_model.py` — held-out evaluation prompts, loads the adapter from `/home/ai/qwen-coder-programming-best`.
## Security model (other work)
- `security_finetune.py` — CodeLlama-7B-Instruct + LoRA for vulnerability analysis.
- Base: `codellama/CodeLlama-7b-Instruct-hf`, output dir: `/home/ai/codellama-security-finetuned`
- `test_security_model.py` — runs the security adapter on sample vulnerable snippets.
## Run
```bash
cd /home/ai
/home/ai/llama-finetune-env/bin/python programming_finetune_aggressive.py # train
/home/ai/llama-finetune-env/bin/python eval_best_model.py # eval
```