How aniq63/finetune-deepseek-own-custom-data works
Project Type and Purpose
• Type: Machine-Learning fine-tuning pipeline for a domain-specific chatbot.
• Purpose: Ingest a custom Q&A dataset, apply Unsloth/LoRA fine-tuning on DeepSeek-LLM-7B in 4-bit, save the adapter + tokenizer, and demonstrate inference.
Core Components
a. Data Ingestion & Storage
• complete_dataset.csv
• Raw CSV stored on disk (or cloud storage).
b. Preprocessing Module
• Code inside finetune_unsloth.ipynb
• Cleans, formats questions/answers into instruction-style samples.
c. Fine-Tuning Engine
• Unsloth library orchestrates QLoRA training.
• HuggingFace Transformers + PEFT + bitsandbytes load & quantize the 7B model.
d. Compute Infrastructure
• 2× NVIDIA T4 GPUs (Colab Pro or similar cloud VM).
• Driver for torch.cuda, communication with bitsandbytes.
e. Model Artifact Storage
• /content/deepseek-cazton-finetuned directory.
• Saved adapter (LoRA weights) + tokenizer.
f. Inference Example
• Notebook cell calling model.generate with max_new_tokens tuning.
• Illustrates user → model → assistant flow.
Highlighted Patterns & Technologies
• ML Pipeline Pattern: sequential stages (Extract → Transform → Load → Train → Serve).
• Quantization & Adapter-Based Fine-Tuning (LoRA + 4-bit).
• Notebook-driven experiment orchestration.
Step-by-Step Sketch
2. → “Preprocessing” (green rectangle)
3. → “Unsloth/LoRA Fine-Tuner” (purple hexagon)
6. → “Inference Notebook Cell” (green rectangle)
7. → “End User” (stick figure)