🔧 Installation
From the root of the repository:📄 Training Data Format
Mellea expects training data in a.jsonl file, where each line contains:
item: A user prompt or messagelabel: A string classification label
📦 Example data.jsonl
🚀 Train a Model
Use them alora train command to fine-tune a LoRA or aLoRA adapter requirement validator.
📌 Parameters
| Flag | Type | Default | Description |
|---|---|---|---|
--basemodel | str | required | Hugging Face model ID or local path |
--outfile | str | required | Directory to save the adapter weights |
--adapter | str | "alora" | Choose between alora or standard lora |
--epochs | int | 6 | Number of training epochs |
--learning-rate | float | 6e-6 | Learning rate |
--batch-size | int | 2 | Per-device batch size |
--max-length | int | 1024 | Max tokenized input length |
--grad-accum | int | 4 | Gradient accumulation steps |
⬆️ Upload to Hugging Face
Use them alora upload command to publish your trained adapter:
- Create the Hugging Face model repo (if it doesn’t exist)
- Upload the contents of the
outfiledirectory - Requires a valid
HF_TOKENviahuggingface-cli login
🛠 Requirements
- Python 3.8+
- Install the following dependencies manually or via
pip install mellea:transformerstrlpeftdatasetshuggingface_hubalora
🧪 Example Datasets for Testing
To verify thealora-train and alora-upload functionality, we tested the CLI using two well-known benchmark datasets: TREC and SST-2. These datasets are small, well-structured, and suitable for validating training pipelines.
📚 1. TREC (Question Classification)
- Link: Hugging Face: TREC Dataset
- Description: The TREC dataset consists of open-domain, fact-based questions divided into broad semantic categories. Each example contains a question and a label such as
DESC,HUM,LOC, etc. - Used format:
📚 2. SST-2 (Stanford Sentiment Treebank v2)
- Link: Hugging Face: sst-2 Dataset
- Description: SST-2 is a binary sentiment classification dataset based on movie review sentences. Each entry is labeled as either
POSITIVEorNEGATIVE. - Used format: