EdukaAI

Fine-Tune with Google Colab

Free Jupyter notebooks with GPU access! No local setup required - perfect for learning and experimentation.

📋 Prerequisites

📦

1. Dataset Ready

Export your dataset from the EdukaAI application Export page. You'll upload it to Colab.

Open the EdukaAI app and go to Export.

👤

2. Google Account

Any Google account (Gmail) gives you free access to Colab.

💡 What is Google Colab?

Google Colab is a free cloud service that provides Jupyter notebooks with access to GPUs. You write and run Python code in your browser - no installation needed!

✅ Free

No cost to use, includes free T4 GPU

✅ No Setup

Everything runs in your browser

✅ GPU Included

Free Tesla T4 GPU (12GB VRAM)

1 Open Google Colab

  1. 1.Go to colab.research.google.com
  2. 2.Sign in with your Google account
  3. 3.Click "New Notebook"

2 Enable GPU (Important!)

⚠️ You MUST enable GPU for training!

  1. 1. Click Runtime in the menu
  2. 2. Select Change runtime type
  3. 3. Choose T4 GPU from the dropdown
  4. 4. Click Save

✅ Verify GPU: Run this in a code cell:

!nvidia-smi

You should see "Tesla T4" in the output

3 Upload Your Dataset

Upload your exported EdukaAI dataset to Colab:

# Upload your dataset
from google.colab import files
uploaded = files.upload()

# The file will be uploaded to the current directory
# You'll see the filename printed after upload

💡 Alternative: You can also mount Google Drive and load the file from there:

from google.colab import drive drive.mount('/content/drive')

4 Run Fine-Tuning

Here's a simple training template using Hugging Face libraries:

# Install libraries
!pip install transformers datasets peft accelerate

# Load libraries
from transformers import AutoModelForCausalLM, AutoTokenizer, TrainingArguments
from datasets import load_dataset
from peft import LoraConfig, get_peft_model

# Load base model
model = AutoModelForCausalLM.from_pretrained(
    "TinyLlama/TinyLlama-1.1B-Chat-v1.0",
    load_in_4bit=True  # Use 4-bit to save memory
)
tokenizer = AutoTokenizer.from_pretrained("TinyLlama/TinyLlama-1.1B-Chat-v1.0")

# Load your EdukaAI dataset
dataset = load_dataset('json', data_files='your_exported_file.json')

# Setup LoRA
lora_config = LoraConfig(
    r=8,
    lora_alpha=16,
    target_modules=["q_proj", "v_proj"],
    lora_dropout=0.05,
    bias="none",
    task_type="CAUSAL_LM"
)
model = get_peft_model(model, lora_config)

# Training arguments
training_args = TrainingArguments(
    output_dir="./results",
    num_train_epochs=1,
    per_device_train_batch_size=1,
    learning_rate=2e-4,
    logging_steps=10,
)

# ... (training code continues)

📚 Pre-made Templates

Search for these on Hugging Face or in Colab's examples:

  • • "LLM fine-tuning with PEFT"
  • • "Alpaca training notebook"
  • • "LoRA fine-tuning tutorial"

5 Save and Download Your Model

# Save your fine-tuned model
model.save_pretrained("./my-finetuned-model")
tokenizer.save_pretrained("./my-finetuned-model")

# Download to your computer
from google.colab import files
!zip -r my-finetuned-model.zip my-finetuned-model
files.download("my-finetuned-model.zip")

⚠️ Free Tier Limits

⏱️ Time Limits

Free tier provides ~12 hours of GPU time per day. Idle sessions timeout after 90 minutes.

💾 Memory

T4 GPU has 12GB VRAM. Use smaller models (1B-3B parameters) or 4-bit quantization.

🔌 Session End

When you close the browser, the runtime resets. Always save results to Google Drive!

💡 Colab Tips

💾 Save to Drive

Mount Google Drive to save models between sessions.

🔋 Prevent Timeout

Keep the browser tab active, or use a JavaScript snippet to prevent idle timeout.

📱 Mobile Friendly

You can start training on your phone and check later!

🤝 Share Notebooks

Share your training notebook with others - they can run it too!