Skip to content

Abdulhamid099/Training-Model

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🧠 Training-Model

A hands-on repository to experiment with training/fine-tuning large language models like Mistral-7B using Hugging Face, LoRA, and custom datasets.

📂 Project Scope

  • Fine-tuning transformer models
  • Hyperparameter optimization
  • Using datasets from local and custom inputs
  • Learning rate scheduling and precision handling
  • Experiment tracking and analysis (you can wire in W&B)

🚀 Tech Stack

  • Python
  • Transformers (Hugging Face)
  • Datasets (JSONL)
  • PEFT / LoRA
  • 4-bit k-bit training (optional)

✅ Quickstart

  1. Create an environment and install deps
make install
  1. Run a quick smoke test (no heavy deps needed)
make smoke
  1. Fine-tune with LoRA (edit the YAML first!)
make train
  • Config: configs/mistral_lora_example.yaml
  • Output: outputs/mistral7b-lora-demo

🗂️ Data Format

Provide a JSONL file where each line contains prompt and response fields. See data/sample.jsonl:

{"prompt": "What is LoRA?", "response": "Low-Rank Adapters..."}

The trainer will render each pair into this template by default:

<s>[INST] {prompt} [/INST] {response}</s>

You can change the template via text_template in the config.

⚙️ Config Highlights

See configs/mistral_lora_example.yaml:

  • base_model_name_or_path: e.g. mistralai/Mistral-7B-Instruct-v0.2
  • use_4bit: toggle 4-bit k-bit training (requires CUDA + bitsandbytes)
  • LoRA: lora_r, lora_alpha, lora_dropout, target_modules
  • Training: batch size, lr, epochs, scheduler, precision

🧪 Scripts

  • src/training/train_lora.py: LoRA fine-tuning script
  • src/data/build_dataset.py: JSONL utilities and HF dataset builder
  • tests/smoke_test.py: minimal data utility test
  • scripts/clone_cashew.sh: optional utility to clone a related HF Space

📌 TODO

  • Add cleaned dataset
  • Upload training logs / metrics
  • Automate preprocessing scripts
  • Experiment with smaller models (e.g. Falcon-1B)

Made with ☕, curiosity, and experimentation.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •